From 1d5291c2704968bac4d6b13ab12134e9e7d19d02 Mon Sep 17 00:00:00 2001 From: afranco Date: Wed, 4 Sep 2024 15:30:52 +0100 Subject: [PATCH] chore(nvim): improved cmp performance and added fugitive --- .config/nvim/lua/plugins/cmp.lua | 7 ++++++- .config/nvim/lua/plugins/git.lua | 1 + .config/nvim/lua/plugins/lsp.lua | 22 +++++++++++++++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua index d9f67b0..6d3367b 100644 --- a/.config/nvim/lua/plugins/cmp.lua +++ b/.config/nvim/lua/plugins/cmp.lua @@ -1,6 +1,7 @@ return { { - "hrsh7th/nvim-cmp", + "yioneko/nvim-cmp", + branch = "perf", event = "VeryLazy", dependencies = { "hrsh7th/cmp-nvim-lsp", -- lsp @@ -28,6 +29,10 @@ return { luasnip.lsp_expand(args.body) end, }, + performance = { + debounce = 0, + throttle = 0, + }, mapping = { [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua index 1d86548..7ee5c5e 100644 --- a/.config/nvim/lua/plugins/git.lua +++ b/.config/nvim/lua/plugins/git.lua @@ -6,5 +6,6 @@ return { require("blame").setup() end }, + "https://github.com/tpope/vim-fugitive" } diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index aeb8875..f01dc80 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -3,6 +3,22 @@ return { { "stevearc/dressing.nvim", event = "VeryLazy", + opts = { + input = { + override = function(conf) + conf.col = -1 + conf.row = 0 + return conf + end, + } + } + }, + { + "smjonas/inc-rename.nvim", + opts = { + input_buffer_type = "dressing", + save_in_cmdline_history = true, + } }, { "williamboman/mason.nvim", @@ -165,6 +181,10 @@ return { client.server_capabilities.semanticTokensProvider = nil end + local rename_func = function() + return ":IncRename " .. vim.fn.expand("") + end + -- Mappings. local bufopts = { noremap = true, silent = true, buffer = ev.buf } vim.keymap.set("n", "e", vim.diagnostic.open_float, bufopts) @@ -176,7 +196,7 @@ return { vim.keymap.set("n", "gi", fzflua.lsp_implementations, bufopts) vim.keymap.set("n", "k", vim.lsp.buf.signature_help, bufopts) vim.keymap.set("n", "D", vim.lsp.buf.type_definition, bufopts) - vim.keymap.set("n", "rn", vim.lsp.buf.rename, bufopts) + vim.keymap.set("n", "rn", rename_func(), bufopts) vim.keymap.set("n", "ca", vim.lsp.buf.code_action, bufopts) vim.keymap.set("n", "ge", vim.diagnostic.goto_next, bufopts) vim.keymap.set("n", "gE", vim.diagnostic.goto_prev, bufopts)