From c76c5d08b0f974722104b52d396cac7803ce7ca2 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Thu, 24 Oct 2024 01:50:05 +0300 Subject: [PATCH] chore(nvim): treesitter config tweaks --- config/nvim/lua/plugins/treesitter.lua | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/config/nvim/lua/plugins/treesitter.lua b/config/nvim/lua/plugins/treesitter.lua index 30a7eaa..a0f64b2 100644 --- a/config/nvim/lua/plugins/treesitter.lua +++ b/config/nvim/lua/plugins/treesitter.lua @@ -8,6 +8,9 @@ return { end, dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects', + 'nvim-treesitter/nvim-treesitter-refactor', + 'nvim-treesitter/nvim-treesitter-context', + 'JoosepAlviste/nvim-ts-context-commentstring', }, config = function() require('nvim-treesitter.configs').setup { @@ -47,6 +50,32 @@ return { 'yaml', }, + refactor = { + navigation = { + enable = true, + -- Assign keymaps to false to disable them, e.g. `goto_definition = false`. + keymaps = { + goto_definition = 'gnd', + list_definitions = 'gnD', + list_definitions_toc = 'gO', + goto_next_usage = '', + goto_previous_usage = '', + }, + }, + smart_rename = { + enable = true, + -- Assign keymaps to false to disable them, e.g. `smart_rename = false`. + keymaps = { + smart_rename = 'grr', + }, + }, + highlight_definitions = { + enable = true, + -- Set to false if you have an `updatetime` of ~100. + clear_on_cursor_move = true, + }, + highlight_current_scope = { enable = false }, + }, highlight = { enable = true }, indent = { enable = true }, incremental_selection = {