nvim/lua/plugins/zk-nvim.lua

35 lines
840 B
Lua
Raw Normal View History

2025-08-21 11:18:50 -05:00
return {
{'zk-org/zk-nvim', name = 'zk', lazy = false,
config = function ()
require('zk').setup({
picker = 'snacks_picker',
lsp = {
config = {
cmd = { "zk", "lsp" },
name = "zk",
},
auto_attach = {
enabled = true,
filetypes = { 'markdown' },
}
}
})
local zk = require("zk")
local commands = require("zk.commands")
local function make_edit_fn(defaults, picker_options)
return function(options)
options = vim.tbl_extend("force", defaults, options or {})
zk.edit(options, picker_options)
end
end
commands.add("ZkOrphans", make_edit_fn({ orphan = true }, { title = "Zk Orphans" }))
commands.add("ZkRecents", make_edit_fn({ createdAfter = "2 weeks ago" }, { title = "Zk Recents" }))
end,
}
}