nvim: Remove hard-coding to fzf-lua in zk-nvim picker
This commit is contained in:
parent
c436fe66fd
commit
246c06b60b
1 changed files with 13 additions and 10 deletions
|
|
@ -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)
|
||||||
|
elseif picker == "fzf_lua" then
|
||||||
require("fzf-lua").live_grep(options)
|
require("fzf-lua").live_grep(options)
|
||||||
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
|
end
|
||||||
|
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,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue