From 12bee2b6eb1d7eb92ceabeabeff3969b0c349fad Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 4 Dec 2025 12:28:07 +0200 Subject: Update --- dotfiles/fish/conf.d/quickedit.fish | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/dotfiles/fish/conf.d/quickedit.fish b/dotfiles/fish/conf.d/quickedit.fish index e9f738a..3c6c333 100644 --- a/dotfiles/fish/conf.d/quickedit.fish +++ b/dotfiles/fish/conf.d/quickedit.fish @@ -27,15 +27,13 @@ function quickedit::postaction end end -function quickedit - set -l prev_dir (pwd) +function quickedit::current_dir set -l grep_pattern . if test (count $argv) -gt 0 set grep_pattern $argv[1] end - cd $QUICKEDIT_DIR set files (find -L . -type f -not -path '*/.*' | grep -E "$grep_pattern") switch (count $files) @@ -51,7 +49,31 @@ function quickedit if editor::helix::open_with_lock $file_path quickedit::postaction $file_path end +end +function quickedit + set -l prev_dir (pwd) + set -l grep_pattern . + + if test (count $argv) -gt 0 + set grep_pattern $argv[1] + end + + cd $QUICKEDIT_DIR + quickedit::current_dir + cd $prev_dir +end + +function quickedit::snippets + set -l prev_dir (pwd) + set -l grep_pattern . + + if test (count $argv) -gt 0 + set grep_pattern $argv[1] + end + + cd $QUICKEDIT_DIR/snippets + quickedit::current_dir cd $prev_dir end @@ -67,11 +89,6 @@ function quickedit::direct cd - end -function quickedit::bytag - set -l tag $argv[1] - quickedit::direct ~/Notes bytag/$tag.md -end - function quickedit::scratchpad quickedit::direct ~/Notes Scratchpad.md end @@ -90,7 +107,6 @@ abbr -a S quickedit::scratchpad abbr -a quicknote quickedit::quicknote abbr -a perf quickedit::performance abbr -a performance quickedit::performance -abbr -a bytag quickedit::bytag abbr -a goals quickedit::performance abbr -a er "ranger $QUICKEDIT_DIR" abbr -a cdquickedit "cd $QUICKEDIT_DIR" @@ -98,3 +114,4 @@ abbr -a cdnotes 'cd ~/Notes' abbr -a cdfish 'cd ~/.config/fish/conf.d' abbr -a cddocs 'cd ~/Documents' abbr -a cdocs 'cd ~/Documents' +abbr -a snippets quickedit::snippets -- cgit v1.2.3