1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
local config = require('nvim-treesitter.parsers').get_parser_configs()
config.gsp = {
install_info = {
url = 'https://git.sr.ht/~mango/tree-sitter-gsp',
files = {'src/parser.c'},
},
filetype = 'gsp',
}
config.hypr = {
install_info = {
url = 'https://github.com/luckasRanarison/tree-sitter-hypr',
files = {'src/parser.c'},
},
filetype = 'hypr',
}
require('nvim-treesitter.configs').setup {
ensure_installed = {
'c',
'go',
'gomod',
'gsp',
'html',
'lua',
'python',
'query',
'rust',
'vim',
'vimdoc',
'zig',
},
sync_install = false,
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<C-Space>',
node_incremental = '<C-Space>',
scope_incremental = '<C-s>',
node_decremental = '<C-Backspace>',
}
},
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
['af'] = '@function.outer',
['if'] = '@function.inner',
['ab'] = '@block.outer',
['ib'] = '@block.inner',
['an'] = '@node.outer',
['in'] = '@node.inner',
},
},
move = {
enable = true,
set_jumps = true,
goto_next_start = {
[']f'] = '@function.outer',
[']b'] = '@block.outer',
[']n'] = '@node.outer',
},
goto_next_end = {
[']F'] = '@function.outer',
[']B'] = '@block.outer',
[']N'] = '@node.outer',
},
goto_previous_start = {
['[f'] = '@function.outer',
['[b'] = '@block.outer',
['[n'] = '@node.outer',
},
goto_previous_end = {
['[F'] = '@function.outer',
['[B'] = '@block.outer',
['[N'] = '@node.outer',
},
},
},
}
|