summaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-06-07 21:19:28 +0200
committerThomas Vanbesien <tvanbesi@proton.me>2026-06-08 16:09:23 +0200
commitd2726bb4e9bcce327a31fb11950851aa4c991ab6 (patch)
tree3cc98cbfdd3667dbcce0f6cece7e73b06c6a0b26 /plugin
parent3b71d66f2a2066868c8f621753bc817cd07ecf74 (diff)
downloadnvim-config-d2726bb4e9bcce327a31fb11950851aa4c991ab6.tar.gz
nvim-config-d2726bb4e9bcce327a31fb11950851aa4c991ab6.zip
misc: add notes launcher
Diffstat (limited to 'plugin')
-rw-r--r--plugin/50-notes.lua18
1 files changed, 10 insertions, 8 deletions
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", "<Leader>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", "<Leader>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", "<Leader>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", "<Leader>nn", vim.cmd.NotesFindTags, { desc = "Fuzzy-find notes" })
+vim.keymap.set("n", "<Leader>nf", vim.cmd.NotesFindFile, { desc = "Fuzzy-find notes file name" })
+vim.keymap.set("n", "<Leader>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)