From 3d9596a6c7ea671bd9cc172346da43b9d365eeff Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Fri, 10 Mar 2023 11:56:00 +0000 Subject: [PATCH] Add treesitter refactor plugin --- config/nvim/lua/config/treesitter.lua | 14 ++++++++++++++ config/nvim/lua/plugins/treesitter.lua | 8 ++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/config/nvim/lua/config/treesitter.lua b/config/nvim/lua/config/treesitter.lua index 8a07b21b..7136d8c6 100644 --- a/config/nvim/lua/config/treesitter.lua +++ b/config/nvim/lua/config/treesitter.lua @@ -17,4 +17,18 @@ return { enable = true, -- disable = { "python" }, }, + refactor = { + smart_rename = { + enable = true, + keymaps = { + smart_rename = "grr", + }, + }, + navigation = { + enable = true, + keymaps = { + goto_definition_lsp_fallback = "gnd", + }, + }, + }, } diff --git a/config/nvim/lua/plugins/treesitter.lua b/config/nvim/lua/plugins/treesitter.lua index dfba47fe..bdabfdc0 100644 --- a/config/nvim/lua/plugins/treesitter.lua +++ b/config/nvim/lua/plugins/treesitter.lua @@ -9,8 +9,8 @@ return { "TSUpdate", "TSEnable", }, - config = function() - require("nvim-treesitter.configs").setup(require "config.treesitter") - -- vim.cmd "TSUpdate" - end, + config = function() require("nvim-treesitter.configs").setup(require "config.treesitter") end, + dependencies = { + "nvim-treesitter/nvim-treesitter-refactor", + }, }