From c78361a6155dd53cd1098f7fdf33acfea20dc903 Mon Sep 17 00:00:00 2001 From: Marcelo Date: Mon, 3 Mar 2025 21:05:55 -0300 Subject: Initial commit. --- lua/config/plugins/notes.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 lua/config/plugins/notes.lua (limited to 'lua/config/plugins/notes.lua') 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", "zn", "ZkNew { title = vim.fn.input('Title: ') }", opts) + + -- Open notes. + vim.api.nvim_set_keymap("n", "zo", "ZkNotes { sort = { 'modified' } }", opts) + -- Open notes associated with the selected tags. + vim.api.nvim_set_keymap("n", "zt", "ZkTags", opts) + + -- Search for the notes matching a given query. + vim.api.nvim_set_keymap("n", "zf", "ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }", opts) + -- Search for the notes matching the current visual selection. + vim.api.nvim_set_keymap("v", "zf", ":'<,'>ZkMatch", opts) + end + } +} -- cgit v1.2.3