nvimrc: fix broken treesitter refactor configuration

This commit is contained in:
Rob Watson 2021-10-04 15:09:46 +02:00
parent f24b6f2dd0
commit 29cd1391ad
1 changed files with 13 additions and 11 deletions

24
nvimrc
View File

@ -542,16 +542,6 @@ require 'nvim-treesitter.configs'.setup {
["[F"] = "@function.inner", ["[F"] = "@function.inner",
}, },
}, },
refactor = {
enable = true,
-- TODO: navigation broken.
navigation = {
keymaps = {
goto_next_usage = "]r",
goto_previous_usage = "[r",
},
},
},
lsp_interop = { lsp_interop = {
enable = true, enable = true,
peek_definition_code = { peek_definition_code = {
@ -560,6 +550,18 @@ require 'nvim-treesitter.configs'.setup {
}, },
}, },
}, },
refactor = {
highlight_definitions = { enable = true },
highlight_current_scope = { enable = true },
navigation = {
enable = true,
keymaps = {
goto_definition_lsp_fallback = "gd",
goto_next_usage = "]r",
goto_previous_usage = "[r",
},
},
},
playground = { playground = {
enable = true, enable = true,
disable = {}, disable = {},
@ -595,7 +597,7 @@ local on_attach = function(client, bufnr)
vim.api.nvim_exec([[autocmd User LspDiagnosticsChanged call lightline#update()]], false) vim.api.nvim_exec([[autocmd User LspDiagnosticsChanged call lightline#update()]], false)
local opts = { noremap=true, silent=false } local opts = { noremap=true, silent=false }
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.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', '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) vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>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.type_definition()<CR>', opts)