From d4677b4cb0f367c871eed674c50eb9555cc8adeb Mon Sep 17 00:00:00 2001 From: Marcelo Date: Thu, 3 Apr 2025 23:49:35 -0300 Subject: Improve Zettelkasten notes keybind situation. --- lua/config/plugins/notes.lua | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'lua/config/plugins') diff --git a/lua/config/plugins/notes.lua b/lua/config/plugins/notes.lua index 57d5d24..a76271e 100644 --- a/lua/config/plugins/notes.lua +++ b/lua/config/plugins/notes.lua @@ -16,21 +16,19 @@ return { }, }) - local opts = { noremap = true, silent = false } + vim.keymap.set("n", "zn", "ZkNew { title = vim.fn.input('Title: ') }", + { noremap = true, silent = false, desc = "Create a new note after asking for its title." }) - -- Create a new note after asking for its title. - vim.api.nvim_set_keymap("n", "zn", "ZkNew { title = vim.fn.input('Title: ') }", opts) + vim.keymap.set("n", "zo", "ZkNotes { sort = { 'modified' } }", + { noremap = true, silent = false, desc = "Open notes." }) + vim.keymap.set("n", "zt", "ZkTags", + { noremap = true, silent = false, desc = "Open notes associated with the selected tags." }) - -- 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) + vim.keymap.set("n", "zf", + "ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }", + { noremap = true, silent = false, desc = "Search for the notes matching a given query." }) + vim.keymap.set("v", "zf", ":'<,'>ZkMatch", + { noremap = true, silent = false, desc = "Search for the notes matching the current visual selection." }) end }, @@ -46,6 +44,7 @@ return { position = "right", width = "block", border = "thick", + language_pad = 1, min_width = min_width, left_pad = 1, right_pad = 1, -- cgit v1.2.3