add zk workflow

fixes #1
This commit is contained in:
Alexander Navarro 2024-09-12 16:55:05 -03:00
parent 595ac566ea
commit 8b85cf7c9e
Signed by untrusted user who does not match committer: anavarro
GPG key ID: 6426043E9FA3E3B5
12 changed files with 373 additions and 47 deletions

View file

@ -11,4 +11,33 @@ return {
},
},
},
{
"zk-org/zk-nvim",
config = function()
require("zk").setup({
picker = "select",
})
function MAP(mode, l, r, desc)
vim.keymap.set(mode, l, r, { desc = desc, silent = true })
end
MAP("n", "<CR>", "<Cmd>lua vim.lsp.buf.definition()<CR>", "Open the link under cursor")
MAP("n", "<leader>zn", "<Cmd>ZkNew { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }<CR>",
"Create new note")
MAP("v", "<leader>zN",
":'<,'>ZkNewFromContentSelection { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }<CR>",
"Create new note using selection as content")
MAP("n", "<leader>zl", "<Cmd>ZkInsertLink<CR>", "Insert Link into cursor position")
MAP("v", "<leader>zl", ":'<,'>ZkInsertLinkAtSelection<CR>", "Insert Link into selection")
MAP("n", "<leader>zb", "<Cmd>ZkBacklinks<CR>", "Backlinks")
MAP("n", "<leader>zo", "<Cmd>ZkLinks<CR>", "Outlinks")
MAP("n", "<leader>zf", "<Cmd>ZkNotes<CR>", "Find note")
MAP("n", "<leader>zt", "<Cmd>ZkTags<CR>", "Find tags")
end
}
}