Add incremental rename

This commit is contained in:
ViViDboarder 2022-06-07 09:52:22 -07:00
parent ae4cb15f72
commit 978d20d4e9
2 changed files with 14 additions and 0 deletions

View File

@ -215,6 +215,15 @@ use("folke/lua-dev.nvim")
-- Better display of lsp diagnostics -- Better display of lsp diagnostics
use("folke/trouble.nvim") use("folke/trouble.nvim")
-- Incremental lsp rename view
use({
"smjonas/inc-rename.nvim",
config = function()
require("inc_rename").setup()
end,
disable = vim.fn.has("nvim-0.7.0") ~= 1,
})
-- Generic linter/formatters in diagnostics API -- Generic linter/formatters in diagnostics API
use({ use({
"jose-elias-alvarez/null-ls.nvim", "jose-elias-alvarez/null-ls.nvim",

View File

@ -111,6 +111,11 @@ local function get_default_attach(override_capabilities)
vim.cmd([[autocmd CursorHold * lua vim.diagnostic.open_float(nil, {focus=false, scope="cursor"})]]) vim.cmd([[autocmd CursorHold * lua vim.diagnostic.open_float(nil, {focus=false, scope="cursor"})]])
end end
-- Use IncRename if available
if utils.try_require("inc_rename") ~= nil then
lsp_keymap("rn", "<cmd>IncRename()<CR>")
end
-- Set some keybinds conditional on server capabilities -- Set some keybinds conditional on server capabilities
if client.resolved_capabilities.document_formatting then if client.resolved_capabilities.document_formatting then
buf_set_keymap("n", "<leader>lf", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts) buf_set_keymap("n", "<leader>lf", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)