-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtreesitter-textobject-config.lua
More file actions
37 lines (33 loc) · 1.02 KB
/
treesitter-textobject-config.lua
File metadata and controls
37 lines (33 loc) · 1.02 KB
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
local M = {
'nvim-mini/mini.ai',
main = 'mini.ai',
dependencies = {
{
'nvim-treesitter/nvim-treesitter-textobjects',
branch = 'main',
init = function()
-- no need to load the plugin, since we only need its queries
require('lazy.core.loader').disable_rtp_plugin('nvim-treesitter-textobjects')
end,
},
}
}
M.opts = function()
local ai = require('mini.ai')
return {
n_lines = 500,
custom_textobjects = {
o = ai.gen_spec.treesitter({
a = { '@block.outer', '@conditional.outer', '@loop.outer' },
i = { '@block.inner', '@conditional.inner', '@loop.inner' },
}, {}),
f = ai.gen_spec.treesitter({ a = '@function.outer', i = '@function.inner' }, {}),
c = ai.gen_spec.treesitter({ a = '@class.outer', i = '@class.inner' }, {}),
},
}
end
M.keys = {
{ 'a', mode = { 'x', 'o' } },
{ 'i', mode = { 'x', 'o' } },
}
return M