mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-02 21:44:37 +02:00
feat(editor): added extra for inc-rename.nvim (#3432)
* feat(editor-extra): Add inc-rename * fix: refactor and moved noice integration --------- Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
This commit is contained in:
parent
ae0d94e048
commit
c50018b791
3 changed files with 40 additions and 15 deletions
38
lua/lazyvim/plugins/extras/editor/inc-rename.lua
Normal file
38
lua/lazyvim/plugins/extras/editor/inc-rename.lua
Normal file
|
@ -0,0 +1,38 @@
|
|||
return {
|
||||
|
||||
-- Rename with cmdpreview
|
||||
recommended = true,
|
||||
desc = "Incremental LSP renaming based on Neovim's command-preview feature",
|
||||
{
|
||||
"smjonas/inc-rename.nvim",
|
||||
cmd = "IncRename",
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- LSP Keymaps
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = function()
|
||||
local keys = require("lazyvim.plugins.lsp.keymaps").get()
|
||||
keys[#keys + 1] = {
|
||||
"<leader>cr",
|
||||
function()
|
||||
local inc_rename = require("inc_rename")
|
||||
return ":" .. inc_rename.config.cmd_name .. " " .. vim.fn.expand("<cword>")
|
||||
end,
|
||||
expr = true,
|
||||
desc = "Rename (inc-rename.nvim)",
|
||||
has = "rename",
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
--- Noice integration
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
presets = { inc_rename = true },
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue