From 0e2016a4a0550ae093d2749c90cc41262071d532 Mon Sep 17 00:00:00 2001 From: Martin Larsson Date: Thu, 15 Jan 2026 18:09:48 +0100 Subject: [PATCH] Change out inc-rename for live-rename --- nvim/lazy-lock.json | 2 +- nvim/lua/plugs/inc_rename.lua | 7 ------ nvim/lua/plugs/live_rename.lua | 44 ++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 8 deletions(-) delete mode 100644 nvim/lua/plugs/inc_rename.lua create mode 100644 nvim/lua/plugs/live_rename.lua diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index e9dda45..ec85147 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -10,9 +10,9 @@ "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "gitsigns.nvim": { "branch": "main", "commit": "5813e4878748805f1518cee7abb50fd7205a3a48" }, "goto-preview": { "branch": "main", "commit": "cf561d10b4b104db20375c48b86cf36af9f96e00" }, - "inc-rename.nvim": { "branch": "main", "commit": "2597bccb57d1b570fbdbd4adf88b955f7ade715b" }, "incline.nvim": { "branch": "main", "commit": "8b54c59bcb23366645ae10edca6edfb9d3a0853e" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "live-rename.nvim": { "branch": "main", "commit": "3a3cddf23b89a17992f9ca67afc5858077769462" }, "logger.nvim": { "branch": "main", "commit": "63dd10c9b9a159fd6cfe08435d9606384ff103c5" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, "markview.nvim": { "branch": "main", "commit": "0a5033326f703d99a8788e2d47753d6298195e8a" }, diff --git a/nvim/lua/plugs/inc_rename.lua b/nvim/lua/plugs/inc_rename.lua deleted file mode 100644 index 1df5bd6..0000000 --- a/nvim/lua/plugs/inc_rename.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "smjonas/inc-rename.nvim", - opts = {}, - keys = { - { "r", ":IncRename " }, - }, -} diff --git a/nvim/lua/plugs/live_rename.lua b/nvim/lua/plugs/live_rename.lua new file mode 100644 index 0000000..50814be --- /dev/null +++ b/nvim/lua/plugs/live_rename.lua @@ -0,0 +1,44 @@ +return { + "saecki/live-rename.nvim", + opts = { + -- Send a `textDocument/prepareRename` request to the server to + -- determine the word to be renamed, can be slow on some servers. + -- Otherwise fallback to using ``. + prepare_rename = true, + --- The timeout for the `textDocument/prepareRename` request and final + --- `textDocument/rename` request when submitting. + request_timeout = 1500, + -- Make an initial `textDocument/rename` request to gather other + -- occurences which are edited and use these ranges to preview. + -- If disabled only the word under the cursor will have a preview. + show_other_ocurrences = true, + -- Try to infer patterns from the initial `textDocument/rename` request + -- and use these to show hopefully better edit previews. + use_patterns = true, + -- The register which is used to temporarily record a macro into. This + -- macro can then be executed on other symbols using the `macrorepeat` + -- rename option. + scratch_register = "l", + keys = { + submit = { + { "n", "" }, + { "v", "" }, + { "i", "" }, + }, + cancel = { + { "n", "" }, + { "n", "q" }, + }, + }, + hl = { + current = "CurSearch", + others = "Search", + }, + } + , + keys = { + { "r", function() + require("live-rename").rename({ cursorpos = 0 }) + end }, + }, +}