diff options
| author | Paul Buetow <paul@buetow.org> | 2025-05-12 21:02:02 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-05-12 21:02:02 +0300 |
| commit | e96974f34aeeef11459a77a5343efae4012f4983 (patch) | |
| tree | 297da06b87222ff98ec0de70287d234631981bcd | |
| parent | 71714deaed6f1e6cdd45c383fc165aacc8296e75 (diff) | |
update quickedit
| -rw-r--r-- | dotfiles/fish/conf.d/quickedit.fish | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/dotfiles/fish/conf.d/quickedit.fish b/dotfiles/fish/conf.d/quickedit.fish index 73d58a8..dca7220 100644 --- a/dotfiles/fish/conf.d/quickedit.fish +++ b/dotfiles/fish/conf.d/quickedit.fish @@ -36,15 +36,17 @@ function quickedit end cd $QUICKEDIT_DIR - find -L . -type f \ - -not -path '*/.*' \ - | grep -E "$grep_pattern" \ - set -l file_path ( - find -L . -type f \ - -not -path '*/.*' \ - | grep -E "$grep_pattern" \ - | fzf - ) + set files (find -L . -type f -not -path '*/.*' | grep -E "$grep_pattern") + + switch (count $files) + case 0 + echo No result found + return + case 1 + set file_path $files[1] + case '*' + set file_path (printf '%s\n' $files | fzf) + end if editor::helix::open_with_lock $file_path quickedit::postaction $file_path |
