The Telescope pickers also allow you to explicitly specify a notebook like so `:Telescope zk notes path=/foo/bar` or so `require('telescope').extensions.zk.notes({ path = '/foo/bar'})`.
However, specifing a `path` is optional, and is usually not necessary; see [Notebook Directory Discovery](#notebook-directory-discovery).
However, specifying a `path` is optional, and is usually not necessary; see [Notebook Directory Discovery](#notebook-directory-discovery).
You can even pass the same additional options to the Telescope pickers as described in [list and tag list commands](#commands).
vim.cmd("command! -nargs=? ZkNew lua require('zk').new(nil, { dir = <q-args> })")-- the command arg (directory) is interpreted relative to the notebook root
-- vim.cmd("command! -nargs=? -complete=dir ZkNew lua require('zk').new(nil, { dir = vim.fn.fnamemodify(<q-args>, ':p') })") -- this would interpret the command arg (dir) relative to the cwd instead
command!-range-nargs=?-complete=luaZkNewLinkluaassert(<range>==2,"ZkNewLink must be called with '<,'> range. Try :'<'>ZkNewLink");require('zk').new_link(nil,assert(loadstring('return '..<q-args>))())
]])
-- The definition of :ZkNewLink is kind of a hack.
-- The lua function that is called by ZkNewLink will always use the '<,'> marks to get the selection.
-- The only way that this command can be called that makes semantical sense is :'<,'>ZkNewLink.
end
end
-- Commands
-- Core Commands
---Indexes the notebook
--
@ -42,13 +46,20 @@ function M.index(path, options)
end)
end
---Creates and opens a new note
---Creates a new note
--
---@param path? string path to explicitly specify the notebook