From dbafb06b8c2281913d295e01bf09db4e3554a4c8 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Tue, 6 Jun 2023 04:54:32 -0600 Subject: change keymaps for treesitter, need more tweaking --- lua/plugins/treesitter.lua | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'lua/plugins') diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 6d423a8..7105fc0 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -19,15 +19,17 @@ return { highlight = { enable = true }, indent = { enable = true, - disable = { 'python' }, + disable = { + 'python', + 'css',}, }, incremental_selection = { enable = true, keymaps = { - init_selection = '', - node_incremental = '', - scope_incremental = '', - node_decremental = '', + init_selection = '', + node_incremental = '', + node_decremental = '', + scope_incremental = '', }, }, textobjects = { @@ -35,16 +37,19 @@ return { enable = true, -- Automatically jump forward to textobj, similar to targets.vim lookahead = true, + include_surrounding_whitespace = false, keymaps = { -- You can use the capture groups defined in textobjects.scm - ['aa'] = '@parameter.outer', - ['ia'] = '@parameter.inner', - ['af'] = '@function.outer', - ['if'] = '@function.inner', - ['ac'] = '@class.outer', - ['ic'] = '@class.inner', + -- The descriptions are simplistic to match the native descriptions + ['aa'] = { query = '@parameter.outer', desc = 'a parameter' }, + ['ia'] = { query = '@parameter.inner', desc = 'a parameter' }, + ['af'] = { query = '@function.outer', desc = 'a function' }, + ['if'] = { query = '@function.inner', desc = 'a function' }, + ['ac'] = { query = '@class.outer', desc = 'a class' }, + ['ic'] = { query = '@class.inner', desc = 'a class' }, }, }, + -- TODO: change these keymaps to better ones move = { enable = true, -- Whether to set jumps in the jumplist @@ -66,13 +71,14 @@ return { ['[]'] = '@class.outer', }, }, + -- TODO: probably change to sa (swap argument) swap = { enable = true, swap_next = { - ['a'] = '@parameter.inner', + ['a'] = { query = '@parameter.inner', desc = 'Swap with next parameter' }, }, swap_previous = { - ['A'] = '@parameter.inner', + ['A'] = { query = '@parameter.inner', desc = 'Swap with previous parameter' }, }, }, }, -- cgit v1.2.3-70-g09d2