diff options
| -rw-r--r-- | dotfiles/fish/conf.d/quickedit.fish | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/dotfiles/fish/conf.d/quickedit.fish b/dotfiles/fish/conf.d/quickedit.fish index d0c5fc0..b3ed9ab 100644 --- a/dotfiles/fish/conf.d/quickedit.fish +++ b/dotfiles/fish/conf.d/quickedit.fish @@ -2,9 +2,14 @@ set -gx QUICKEDIT_DIR ~/QuickEdit 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 - set -l file_path (find -L . -type f -not -path '*/.*' | fzf) + set -l file_path (find -L . -type f -not -path '*/.*' | grep "$grep_pattern" | fzf) $EDITOR $file_path # Go to git toplevel dir (if exists) @@ -25,6 +30,7 @@ function quickedit cd $prev_dir end + abbr -a cdquickedit "cd $QUICKEDIT_DIR" abbr -a ,qe quickedit abbr -a ,ne quickedit |
