nvim: Remove hard-coding to fzf-lua in zk-nvim picker

This commit is contained in:
Marty Oehme 2025-08-23 12:38:45 +02:00
parent c436fe66fd
commit 246c06b60b
Signed by: Marty
GPG key ID: 4E535BC19C61886E

View file

@ -263,6 +263,13 @@ local prose_plugs = {
end end
end, end,
config = function() config = function()
local picker = "select"
if require("core.util").is_available("fzf-lua") then
picker = "fzf_lua"
elseif require("core.util").is_available("telescope") then
picker = "telescope"
end
require("zk.commands").add("ZkOrphans", function(opts) require("zk.commands").add("ZkOrphans", function(opts)
opts = vim.tbl_extend("force", { orphan = true }, opts or {}) opts = vim.tbl_extend("force", { orphan = true }, opts or {})
require("zk").edit(opts, { title = "Zk Orphans" }) require("zk").edit(opts, { title = "Zk Orphans" })
@ -285,21 +292,17 @@ local prose_plugs = {
return collection[path] return collection[path]
end, end,
}, opts or {}) }, opts or {})
-- FIXME: Don't hard-code this so much? if picker == "telescope" then
-- require("telescope.builtin").live_grep(options) require("telescope.builtin").live_grep(options)
require("fzf-lua").live_grep(options) elseif picker == "fzf_lua" then
require("fzf-lua").live_grep(options)
end
end) end)
local picker = "select"
if require("core.util").is_available("fzf-lua") then
picker = "fzf_lua"
elseif require("core.util").is_available("telescope") then
picker = "telescope"
end
require("zk").setup({ require("zk").setup({
picker = picker, picker = picker,
lsp = { lsp = {
config = { config = {
filetypes = { "markdown", "quarto", "djot" }, filetypes = md_like,
}, },
auto_attach = { auto_attach = {
enabled = true, enabled = true,