From 2493af44fcf2d9b87cc8160fa3baaa1e0d9a3462 Mon Sep 17 00:00:00 2001 From: Charles Danesi Date: Sun, 1 Dec 2024 07:18:26 -0500 Subject: [PATCH] feat: add treesitter-refactor plugins --- .config/nvim/lua/plugins/ts-refactor.lua | 35 ++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .config/nvim/lua/plugins/ts-refactor.lua diff --git a/.config/nvim/lua/plugins/ts-refactor.lua b/.config/nvim/lua/plugins/ts-refactor.lua new file mode 100644 index 0000000..3489df7 --- /dev/null +++ b/.config/nvim/lua/plugins/ts-refactor.lua @@ -0,0 +1,35 @@ +return { + 'nvim-treesitter/nvim-treesitter-refactor', + event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' }, + dependencies = 'nvim-treesitter', + opts = { + refactor = { + highlight_definitions = { + enable = true, + clear_on_cursor_move = true, -- Set to false if you have an `updatetime` of ~100. + }, + highlight_current_scope = { + enable = false, + }, + smart_rename = { + enable = true, + keymaps = { + smart_rename = 'grr', + }, + }, + navigation = { + enable = true, + keymaps = { + goto_definition_lsp_fallback = 'gd', + list_definitions = 'gnD', + list_definitions_toc = 'gO', + goto_next_usage = '', + goto_previous_usage = '', + }, + }, + }, + }, + config = function(_, opts) + require('nvim-treesitter.configs').setup(opts) + end, +}