aboutsummaryrefslogtreecommitdiffhomepage
path: root/vim/lua/configs/treesitter.lua
diff options
context:
space:
mode:
Diffstat (limited to 'vim/lua/configs/treesitter.lua')
-rw-r--r--vim/lua/configs/treesitter.lua62
1 files changed, 62 insertions, 0 deletions
diff --git a/vim/lua/configs/treesitter.lua b/vim/lua/configs/treesitter.lua
new file mode 100644
index 0000000..8375d5b
--- /dev/null
+++ b/vim/lua/configs/treesitter.lua
@@ -0,0 +1,62 @@
1return {
2 -- Add languages to be installed here that you want installed for treesitter
3 ensure_installed = { 'bash', 'c', 'html', 'css', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' },
4
5 -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
6 auto_install = true,
7
8 -- highlight = { enable = true },
9 incremental_selection = {
10 enable = true,
11 keymaps = {
12 init_selection = '<c-space>',
13 node_incremental = '<c-space>',
14 scope_incremental = '<c-s>',
15 node_decremental = '<M-space>',
16 },
17 },
18 textobjects = {
19 select = {
20 enable = true,
21 lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
22 keymaps = {
23 -- You can use the capture groups defined in textobjects.scm
24 ['aa'] = '@parameter.outer',
25 ['ia'] = '@parameter.inner',
26 ['af'] = '@function.outer',
27 ['if'] = '@function.inner',
28 ['ac'] = '@class.outer',
29 ['ic'] = '@class.inner',
30 },
31 },
32 move = {
33 enable = true,
34 set_jumps = true, -- whether to set jumps in the jumplist
35 goto_next_start = {
36 [']f'] = '@function.outer',
37 [']c'] = '@class.outer',
38 },
39 goto_next_end = {
40 [']F'] = '@function.outer',
41 [']C'] = '@class.outer',
42 },
43 goto_previous_start = {
44 ['[f'] = '@function.outer',
45 ['[c'] = '@class.outer',
46 },
47 goto_previous_end = {
48 ['[F'] = '@function.outer',
49 ['[C'] = '@class.outer',
50 },
51 },
52 swap = {
53 enable = true,
54 swap_next = {
55 ['<leader>a'] = '@parameter.inner',
56 },
57 swap_previous = {
58 ['<leader>A'] = '@parameter.inner',
59 },
60 },
61 },
62}