mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-02 05:24:35 +02:00
feat(mini.ai): add more objects d,e,g,u,U (#2769)
This commit is contained in:
parent
52ee7ef696
commit
f655139281
1 changed files with 25 additions and 0 deletions
|
@ -212,6 +212,26 @@ return {
|
||||||
f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }, {}),
|
f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }, {}),
|
||||||
c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }, {}),
|
c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }, {}),
|
||||||
t = { "<([%p%w]-)%f[^<%w][^<>]->.-</%1>", "^<.->().*()</[^/]->$" },
|
t = { "<([%p%w]-)%f[^<%w][^<>]->.-</%1>", "^<.->().*()</[^/]->$" },
|
||||||
|
d = { "%f[%d]%d+" }, -- digits
|
||||||
|
e = { -- Word with case
|
||||||
|
{
|
||||||
|
"%u[%l%d]+%f[^%l%d]",
|
||||||
|
"%f[%S][%l%d]+%f[^%l%d]",
|
||||||
|
"%f[%P][%l%d]+%f[^%l%d]",
|
||||||
|
"^[%l%d]+%f[^%l%d]",
|
||||||
|
},
|
||||||
|
"^().*()$",
|
||||||
|
},
|
||||||
|
g = function() -- Whole buffer, similar to `gg` and 'G' motion
|
||||||
|
local from = { line = 1, col = 1 }
|
||||||
|
local to = {
|
||||||
|
line = vim.fn.line("$"),
|
||||||
|
col = math.max(vim.fn.getline("$"):len(), 1),
|
||||||
|
}
|
||||||
|
return { from = from, to = to }
|
||||||
|
end,
|
||||||
|
u = ai.gen_spec.function_call(), -- u for "Usage"
|
||||||
|
U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
@ -238,10 +258,15 @@ return {
|
||||||
a = "Argument",
|
a = "Argument",
|
||||||
b = "Balanced ), ], }",
|
b = "Balanced ), ], }",
|
||||||
c = "Class",
|
c = "Class",
|
||||||
|
d = "Digit(s)",
|
||||||
|
e = "Word in CamelCase & snake_case",
|
||||||
f = "Function",
|
f = "Function",
|
||||||
|
g = "Entire file",
|
||||||
o = "Block, conditional, loop",
|
o = "Block, conditional, loop",
|
||||||
q = "Quote `, \", '",
|
q = "Quote `, \", '",
|
||||||
t = "Tag",
|
t = "Tag",
|
||||||
|
u = "Use/call function & method",
|
||||||
|
U = "Use/call without dot in name",
|
||||||
}
|
}
|
||||||
local a = vim.deepcopy(i)
|
local a = vim.deepcopy(i)
|
||||||
for k, v in pairs(a) do
|
for k, v in pairs(a) do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue