summaryrefslogtreecommitdiffstats
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
commitd8d52f90ffce5db92675c624f32d497d2e15fceb (patch)
tree8c3c6e86e797445501d8324553f2eab196ee4859
parentb3bf3fb2ee8605344a4e4d68807d0dfa22f48561 (diff)
downloaddotfiles-d8d52f90ffce5db92675c624f32d497d2e15fceb.tar.gz
dotfiles-d8d52f90ffce5db92675c624f32d497d2e15fceb.zip
misc: add notes launcher
-rw-r--r--.config/kglobalshortcutsrc3
-rw-r--r--.config/nvim/plugin/50-notes.lua18
-rwxr-xr-x.local/bin/notes9
-rw-r--r--.local/share/applications/net.local.notes.desktop7
4 files changed, 29 insertions, 8 deletions
diff --git a/.config/kglobalshortcutsrc b/.config/kglobalshortcutsrc
index a6b23ad..f4d381e 100644
--- a/.config/kglobalshortcutsrc
+++ b/.config/kglobalshortcutsrc
@@ -274,6 +274,9 @@ _launch=Meta+Shift+B
[services][foot.desktop]
_launch=Meta+Shift+T
+[services][net.local.notes.desktop]
+_launch=Meta+Shift+N
+
[services][org.kde.dolphin.desktop]
_launch=Meta+Shift+E
diff --git a/.config/nvim/plugin/50-notes.lua b/.config/nvim/plugin/50-notes.lua
index fec0dd2..59f582e 100644
--- a/.config/nvim/plugin/50-notes.lua
+++ b/.config/nvim/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)
diff --git a/.local/bin/notes b/.local/bin/notes
new file mode 100755
index 0000000..05ca7c2
--- /dev/null
+++ b/.local/bin/notes
@@ -0,0 +1,9 @@
+#!/usr/bin/bash
+set -euo pipefail
+
+# Open the notes directory in foot, inside a persistent tmux session named
+# "notes" (stolen if it already exists), landing straight into an fzf picker
+cd "$NOTES_DIR"
+exec foot --app-id=notes -- \
+ tmux new-session -A -D -s notes -- \
+ nvim -c "NotesFindTags"
diff --git a/.local/share/applications/net.local.notes.desktop b/.local/share/applications/net.local.notes.desktop
new file mode 100644
index 0000000..b6f4200
--- /dev/null
+++ b/.local/share/applications/net.local.notes.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Exec=/home/tvanbesi/.local/bin/notes
+Name=notes
+NoDisplay=true
+StartupNotify=false
+Type=Application
+X-KDE-GlobalAccel-CommandShortcut=true