From d2726bb4e9bcce327a31fb11950851aa4c991ab6 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Sun, 7 Jun 2026 21:19:28 +0200 Subject: misc: add notes launcher --- plugin/50-notes.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'plugin/50-notes.lua') diff --git a/plugin/50-notes.lua b/plugin/50-notes.lua index fec0dd2..59f582e 100644 --- a/plugin/50-notes.lua +++ b/plugin/50-notes.lua @@ -99,17 +99,19 @@ vim.api.nvim_create_autocmd("BufWritePost", { generate_tags() -vim.keymap.set("n", "nn", function() +vim.api.nvim_create_user_command("NotesFindTags", function() require("fzf-lua").tags({ ctags_file = tagfile, cwd = notes_dir }) -end, { desc = "Fuzzy-find notes" }) - -vim.keymap.set("n", "nf", function() +end, { desc = "Fuzzy-find notes (tag,name,section)" }) +vim.api.nvim_create_user_command("NotesFindFile", function() require("fzf-lua").files({ cwd = notes_dir }) -end, { desc = "Fuzzy-find notes file name" }) - -vim.keymap.set("n", "ng", function() +end, { desc = "Fuzzy-find notes (name)" }) +vim.api.nvim_create_user_command("NotesFindGrep", function() require("fzf-lua").live_grep({ cwd = notes_dir }) -end, { desc = "Fuzzy-find notes content" }) +end, { desc = "Fuzzy-find notes (content)" }) + +vim.keymap.set("n", "nn", vim.cmd.NotesFindTags, { desc = "Fuzzy-find notes" }) +vim.keymap.set("n", "nf", vim.cmd.NotesFindFile, { desc = "Fuzzy-find notes file name" }) +vim.keymap.set("n", "ng", vim.cmd.NotesFindGrep, { desc = "Fuzzy-find notes content" }) -- A note's path relative to the notes dir, without `.md`, or nil if not a note. local function note_name(path) -- cgit v1.3.1