diff options
Diffstat (limited to 'lua/config/plugins/notes.lua')
| -rw-r--r-- | lua/config/plugins/notes.lua | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lua/config/plugins/notes.lua b/lua/config/plugins/notes.lua new file mode 100644 index 0000000..c374e94 --- /dev/null +++ b/lua/config/plugins/notes.lua @@ -0,0 +1,35 @@ +return { + { + "zk-org/zk-nvim", + config = function() + require("zk").setup({ + picker = "telescope", + lsp = { + config = { + cmd = { "zk", "lsp" }, + name = "zk", + }, + auto_attach = { + enabled = true, + filetypes = { "markdown" }, + }, + }, + }) + + local opts = { noremap = true, silent = false } + + -- Create a new note after asking for its title. + vim.api.nvim_set_keymap("n", "<leader>zn", "<Cmd>ZkNew { title = vim.fn.input('Title: ') }<CR>", opts) + + -- Open notes. + vim.api.nvim_set_keymap("n", "<leader>zo", "<Cmd>ZkNotes { sort = { 'modified' } }<CR>", opts) + -- Open notes associated with the selected tags. + vim.api.nvim_set_keymap("n", "<leader>zt", "<Cmd>ZkTags<CR>", opts) + + -- Search for the notes matching a given query. + vim.api.nvim_set_keymap("n", "<leader>zf", "<Cmd>ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }<CR>", opts) + -- Search for the notes matching the current visual selection. + vim.api.nvim_set_keymap("v", "<leader>zf", ":'<,'>ZkMatch<CR>", opts) + end + } +} |
