This commit is contained in:
sankalp committed 2025-06-02 15:43:05 +05:45
1 parent 2c6982ecdd
commit b6e0e9f63c
35 files changed
+1155 -1236

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
local ai = require('mini.ai')
ai.setup({
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' }, {}),
t = { '<([%p%w]-)%f[^<%w][^<>]->.-</%1>', '^<.->().*()</[^/]->$' },
},
mappings = {
-- Main textobject prefixes
around = 'a',
inside = 'i',
-- Next/last variants
around_next = 'an',
inside_next = 'in',
around_last = 'al',
inside_last = 'il',
-- Move cursor to corresponding edge of `a` textobject
goto_left = 'g[',
goto_right = 'g]',
},
-- How to search for object
-- 'cover', 'cover_or_next', 'cover_or_prev','cover_or_nearest', 'next', 'previous', 'nearest'.
search_method = 'cover_or_next',
n_lines = 500,
silent = false,
})