nvim: telescope: refactor global picker options to the proper place

This commit is contained in:
Fernando Schauenburg 2025-07-04 22:37:50 +02:00
parent 40543164f6
commit 1f502f1942

View file

@ -17,14 +17,15 @@ local pickers = setmetatable({
no_ignore = true, no_ignore = true,
no_ignore_parent = true, no_ignore_parent = true,
}), }),
all_man_pages = builtin("man_pages", {
sections = { "ALL" },
}),
colorscheme = builtin("colorscheme", { enable_preview = true }),
document_diagnostics = builtin("diagnostics", { bufnr = 0 }), document_diagnostics = builtin("diagnostics", { bufnr = 0 }),
workspace_diagnostics = builtin("diagnostics"), workspace_diagnostics = builtin("diagnostics"),
dotfiles = builtin("find_files", { cwd = "~/.dotfiles", hidden = true }), dotfiles = builtin("find_files", {
plugins = builtin("find_files", { cwd = vim.fn.stdpath("data") .. "/lazy" }), cwd = "~/.dotfiles",
hidden = true,
}),
plugins = builtin("find_files", {
cwd = vim.fn.stdpath("data") .. "/lazy",
}),
selection = function(title) selection = function(title)
return function() return function()
local text = require("util").get_selected_text() local text = require("util").get_selected_text()
@ -34,7 +35,6 @@ local pickers = setmetatable({
} }
end end
end, end,
here = builtin("current_buffer_fuzzy_find"),
}, { }, {
-- Fall back to telescope's built-in pickers if a custom one is not defined -- Fall back to telescope's built-in pickers if a custom one is not defined
-- above, but make sure to keep the title we defined. -- above, but make sure to keep the title we defined.
@ -87,14 +87,14 @@ return {
{ "gr", pickers.live_grep " Live grep" , desc = "Live [gr]ep" }, { "gr", pickers.live_grep " Live grep" , desc = "Live [gr]ep" },
{ "gf", pickers.git_files " Git files" , desc = "[g]it [f]iles" }, { "gf", pickers.git_files " Git files" , desc = "[g]it [f]iles" },
{ "gc", pickers.git_commits " Commits" , desc = "[g]it [c]ommits" }, { "gc", pickers.git_commits " Commits" , desc = "[g]it [c]ommits" },
{ "h", pickers.here " Current buffer" , desc = "[b]uffer [h]ere" }, { "h", pickers.current_buffer_fuzzy_find " Current buffer" , desc = "[h]ere (currenf buffer)" },
{ "H", pickers.highlights "󰌶 Highlights" , desc = "[H]ighlights" }, { "H", pickers.highlights "󰌶 Highlights" , desc = "[H]ighlights" },
--"i" used in nerdy --"i" used in nerdy
{ "j", pickers.jumplist " Jumplist" , desc = "[j]umplist" }, { "j", pickers.jumplist " Jumplist" , desc = "[j]umplist" },
{ "k", pickers.keymaps " Keymaps" , desc = "[k]eymaps" }, { "k", pickers.keymaps " Keymaps" , desc = "[k]eymaps" },
{ "K", pickers.help_tags " Help tags" , desc = "[K] help/documentation" }, { "K", pickers.help_tags " Help tags" , desc = "[K] help/documentation" },
{ "l", pickers.loclist " Location list" , desc = "[l]ocation List" }, { "l", pickers.loclist " Location list" , desc = "[l]ocation List" },
{ "m", pickers.all_man_pages " Man pages" , desc = "[m]an pages" }, { "m", pickers.man_pages " Man pages" , desc = "[m]an pages" },
--"n" used in vim-notify --"n" used in vim-notify
{ "o", pickers.vim_options " Vim options" , desc = "[o]ptions" }, { "o", pickers.vim_options " Vim options" , desc = "[o]ptions" },
{ "p", pickers.plugins " Installed Plugins" , desc = "[p]lugins" }, { "p", pickers.plugins " Installed Plugins" , desc = "[p]lugins" },
@ -189,8 +189,16 @@ return {
i = { ["<c-x>"] = actions.delete_buffer }, i = { ["<c-x>"] = actions.delete_buffer },
}, },
}, },
colorscheme = { theme = "dropdown" }, colorscheme = {
spell_suggest = { theme = "cursor" }, enable_preview = true,
theme = "dropdown",
},
man_pages = {
sections = { "ALL" },
},
spell_suggest = {
theme = "cursor",
},
}, },
} }
end, end,