From 7d1ae8c1f4c3280b20a724f5dc68181ca3ad30db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 12 Aug 2023 16:46:45 +0200 Subject: [PATCH] feat(nvim): add inc-rename.nvim --- modules/programs/nvim/plugins/default.nix | 13 +++++++++++++ modules/programs/nvim/plugins/nvim-lspconfig.lua | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/modules/programs/nvim/plugins/default.nix b/modules/programs/nvim/plugins/default.nix index 3118eb9..55ba586 100644 --- a/modules/programs/nvim/plugins/default.nix +++ b/modules/programs/nvim/plugins/default.nix @@ -135,6 +135,19 @@ with builtins; plugin = neodev-nvim; conf = readFile ./neodev-nvim.lua; } + { + plugin = inc-rename-nvim; + conf = /* lua */ '' + require("inc_rename").setup { + input_buffer_type = "dressing", + } + ''; + dependencies = [ + { + plugin = dressing-nvim; + } + ]; + } ]; } { diff --git a/modules/programs/nvim/plugins/nvim-lspconfig.lua b/modules/programs/nvim/plugins/nvim-lspconfig.lua index 81a1421..97b4de3 100644 --- a/modules/programs/nvim/plugins/nvim-lspconfig.lua +++ b/modules/programs/nvim/plugins/nvim-lspconfig.lua @@ -28,9 +28,16 @@ local on_attach_def = function(client, bufnr) }, [""] = { l = { + name = "lsp", d = { vim.diagnostic.open_float, "Open diagnostic window" }, c = { vim.lsp.buf.code_action, "Code action" }, - r = { vim.lsp.buf.rename, "Rename" }, + r = { + function() + return ":IncRename " .. vim.fn.expand("") + end, + "Rename", + expr = true, + }, f = { function() vim.lsp.buf.format({ async = true })