From deb327e5ce611798d535348bca8305df3a6a4c34 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Tue, 8 Aug 2023 18:23:55 +0200 Subject: [PATCH] vim/treesitter: make sure to load plugin on commands --- .../nvim/lua/fschauen/plugins/treesitter.lua | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/config/nvim/lua/fschauen/plugins/treesitter.lua b/config/nvim/lua/fschauen/plugins/treesitter.lua index e001194..2b4bb27 100644 --- a/config/nvim/lua/fschauen/plugins/treesitter.lua +++ b/config/nvim/lua/fschauen/plugins/treesitter.lua @@ -8,7 +8,6 @@ return { }, main = 'nvim-treesitter.configs', - opts = { ensure_installed = { 'bash', @@ -29,14 +28,12 @@ return { 'vimdoc', 'yaml', }, - highlight = { enable = true, disable = { 'vimdoc', }, }, - incremental_selection = { enable = true, keymaps = { @@ -46,18 +43,15 @@ return { scope_incremental = nil, -- disabled, normally mapped in visual mode }, }, - refactor = { highlight_definitions = { enable = true }, highlight_current_scope = { enable = false }, - smart_rename = { enable = true, keymaps = { smart_rename = 'grr', }, }, - navigation = { enable = true, keymaps = { @@ -69,7 +63,6 @@ return { }, }, }, - textobjects = { select = { enable = true, @@ -87,14 +80,23 @@ return { }, }, }, - playground = { enable = true, }, }, - - event = { 'BufReadPost', 'BufNewFile' }, - + event = { + 'BufReadPost', + 'BufNewFile' + }, + cmd = { + 'TSInstall', + 'TSUninstall', + 'TSUpdate', + 'TSUpdateSync', + 'TSInstallInfo', + 'TSInstallSync', + 'TSInstallFromGrammar', + }, keys = { { 'tp', 'TSPlaygroundToggle' }, { 'th', 'TSHighlightCapturesUnderCursor' },