fix: refactor and moved noice integration

This commit is contained in:
Folke Lemaitre 2024-06-04 09:49:35 +02:00
parent d65e74cb58
commit 41aa08f16b
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 18 additions and 5 deletions

View file

@ -1,14 +1,19 @@
return { return {
-- Rename with cmdpreview
recommended = true,
desc = "Incremental LSP renaming based on Neovim's command-preview feature",
{ {
"smjonas/inc-rename.nvim", "smjonas/inc-rename.nvim",
cmd = "IncRename", cmd = "IncRename",
config = true, opts = {},
}, },
-- LSP Keymaps
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
init = function() opts = function()
local keys = require("lazyvim.plugins.lsp.keymaps").get() local keys = require("lazyvim.plugins.lsp.keymaps").get()
keys[#keys + 1] = { keys[#keys + 1] = {
"<leader>cr", "<leader>cr",
function() function()
@ -16,9 +21,18 @@ return {
return ":" .. inc_rename.config.cmd_name .. " " .. vim.fn.expand("<cword>") return ":" .. inc_rename.config.cmd_name .. " " .. vim.fn.expand("<cword>")
end, end,
expr = true, expr = true,
desc = "Rename", desc = "Rename (inc-rename.nvim)",
has = "rename", has = "rename",
} }
end, end,
}, },
--- Noice integration
{
"folke/noice.nvim",
optional = true,
opts = {
presets = { inc_rename = true },
},
},
} }

View file

@ -299,7 +299,6 @@ return {
bottom_search = true, bottom_search = true,
command_palette = true, command_palette = true,
long_message_to_split = true, long_message_to_split = true,
inc_rename = true,
}, },
}, },
-- stylua: ignore -- stylua: ignore