mirror of https://github.com/mickael-menu/zk-nvim
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
922 B
Lua
27 lines
922 B
Lua
local zk = require("zk")
|
|
|
|
---@param opts? table additional options for zk, telescope options, all optional and in one table
|
|
---@see https://github.com/zk-org/zk/blob/main/docs/editors-integration.md#zklist
|
|
local function show_notes(opts)
|
|
zk.edit(opts, { picker = "telescope", telescope = opts })
|
|
end
|
|
|
|
---@param opts? table additional options for zk, telescope options, all optional and in one table
|
|
---@see https://github.com/zk-org/zk/blob/main/docs/editors-integration.md#zktaglist
|
|
local function show_tags(opts)
|
|
zk.pick_tags(opts, { picker = "telescope", telescope = opts }, function(tags)
|
|
tags = vim.tbl_map(function(v)
|
|
return v.name
|
|
end, tags)
|
|
opts = vim.tbl_extend("force", { tags = tags }, opts or {})
|
|
zk.edit(opts, { picker = "telescope", telescope = opts })
|
|
end)
|
|
end
|
|
|
|
return require("telescope").register_extension({
|
|
exports = {
|
|
notes = show_notes,
|
|
tags = show_tags,
|
|
},
|
|
})
|