mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 09:48:59 +02:00
feat(config): make kind filter configurable for telescope/aerial/...
This commit is contained in:
parent
20d36ccd84
commit
c555e17e48
2 changed files with 41 additions and 32 deletions
|
@ -84,6 +84,26 @@ local defaults = {
|
|||
Variable = " ",
|
||||
},
|
||||
},
|
||||
---@type table<string, string[]>?
|
||||
kind_filter = {
|
||||
default = {
|
||||
"Class",
|
||||
"Constructor",
|
||||
"Enum",
|
||||
"Field",
|
||||
"Function",
|
||||
"Interface",
|
||||
"Method",
|
||||
"Module",
|
||||
"Property",
|
||||
"Struct",
|
||||
"Trait",
|
||||
},
|
||||
-- you can specify a different filter for each filetype
|
||||
-- lua = {
|
||||
-- "Function",
|
||||
-- },
|
||||
},
|
||||
}
|
||||
|
||||
M.json = {
|
||||
|
@ -167,6 +187,17 @@ function M.setup(opts)
|
|||
Util.track()
|
||||
end
|
||||
|
||||
---@param buf? number
|
||||
---@return string[]?
|
||||
function M.get_kind_filter(buf)
|
||||
buf = (buf == nil or buf == 0) and vim.api.nvim_get_current_buf() or buf
|
||||
local ft = vim.bo[buf].filetype
|
||||
if M.kind_filter == false then
|
||||
return
|
||||
end
|
||||
return M.kind_filter[ft] or M.kind_filter.default
|
||||
end
|
||||
|
||||
---@param name "autocmds" | "options" | "keymaps"
|
||||
function M.load(name)
|
||||
local function _load(mod)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue