From 617fea026bb0474904822ee78f4f05be448aaa9e Mon Sep 17 00:00:00 2001 From: xHyroM Date: Mon, 21 Aug 2023 15:33:55 +0200 Subject: [PATCH] make lsp to update in insert mode --- .config/nvim/after/plugin/lsp.lua | 5 ++++- .config/nvim/after/plugin/toggleterm.lua | 21 +++++++++++++++++++++ .config/nvim/lua/hyrik/packer.lua | 4 ++++ .config/nvim/plugin/packer_compiled.lua | 5 +++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .config/nvim/after/plugin/toggleterm.lua diff --git a/.config/nvim/after/plugin/lsp.lua b/.config/nvim/after/plugin/lsp.lua index e3e24a4..bb77954 100644 --- a/.config/nvim/after/plugin/lsp.lua +++ b/.config/nvim/after/plugin/lsp.lua @@ -58,5 +58,8 @@ end) lsp.setup() vim.diagnostic.config({ - virtual_text = true + virtual_text = true, + update_in_insert = true, + underline = true, + signs = true }) diff --git a/.config/nvim/after/plugin/toggleterm.lua b/.config/nvim/after/plugin/toggleterm.lua new file mode 100644 index 0000000..2316106 --- /dev/null +++ b/.config/nvim/after/plugin/toggleterm.lua @@ -0,0 +1,21 @@ +require("toggleterm").setup({ + start_in_insert = true, + insert_mappings = true, + terminal_mappings = true, + persist_size = true, + direction = 'horizontal', + close_on_exit = true, + shell = vim.o.shell, + float_opts = { + border = 'curved', + }, + winbar = { + enabled = false, + name_formatter = function(term) -- term: Terminal + return term.name + end + }, +}) + +vim.keymap.set("n", "tt", vim.cmd.ToggleTerm); +vim.keymap.set("n", "tf", function() vim.cmd.ToggleTerm("direction=float") end); diff --git a/.config/nvim/lua/hyrik/packer.lua b/.config/nvim/lua/hyrik/packer.lua index 00f5ff4..f1a6259 100644 --- a/.config/nvim/lua/hyrik/packer.lua +++ b/.config/nvim/lua/hyrik/packer.lua @@ -42,4 +42,8 @@ return require("packer").startup(function(use) {"L3MON4D3/LuaSnip"}, -- Required } } + + use { + "akinsho/toggleterm.nvim", tag = '*' + } end) diff --git a/.config/nvim/plugin/packer_compiled.lua b/.config/nvim/plugin/packer_compiled.lua index 173e4fe..7c5dd99 100644 --- a/.config/nvim/plugin/packer_compiled.lua +++ b/.config/nvim/plugin/packer_compiled.lua @@ -149,6 +149,11 @@ _G.packer_plugins = { path = "/home/hyro/.local/share/nvim/site/pack/packer/start/telescope.nvim", url = "https://github.com/nvim-telescope/telescope.nvim" }, + ["toggleterm.nvim"] = { + loaded = true, + path = "/home/hyro/.local/share/nvim/site/pack/packer/start/toggleterm.nvim", + url = "https://github.com/akinsho/toggleterm.nvim" + }, undotree = { loaded = true, path = "/home/hyro/.local/share/nvim/site/pack/packer/start/undotree",