nvimrc: enable treesitter rename

This commit is contained in:
Rob Watson 2021-10-04 15:08:32 +02:00
parent 29cd1391ad
commit f9df2583f0
1 changed files with 7 additions and 0 deletions

7
nvimrc
View File

@ -553,6 +553,12 @@ require 'nvim-treesitter.configs'.setup {
refactor = {
highlight_definitions = { enable = true },
highlight_current_scope = { enable = true },
smart_rename = {
enable = true,
keymaps = {
smart_rename = "grr",
},
},
navigation = {
enable = true,
keymaps = {
@ -597,6 +603,7 @@ local on_attach = function(client, bufnr)
vim.api.nvim_exec([[autocmd User LspDiagnosticsChanged call lightline#update()]], false)
local opts = { noremap=true, silent=false }
-- Go to definition is now handled by treesitter, with LSP fallback:
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<Cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)