diff options
| -rw-r--r-- | home-manager/config/fish/config.fish | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/home-manager/config/fish/config.fish b/home-manager/config/fish/config.fish index f881f4e..172526d 100644 --- a/home-manager/config/fish/config.fish +++ b/home-manager/config/fish/config.fish @@ -87,25 +87,18 @@ function pwgen --wraps pwgen end end -if [ -n $has_nvim ] - if [ -n $has_fd ] - set -gx FZF_DEFAULT_COMMAND "fd --type f --strip-cwd-prefix --hidden --exclude .git" - end - function ee - if [ (count $argv) -eq 0 ] - fzf --reverse --bind 'enter:become(nvim {})' - else - find $argv[1] -type f -print0 | fzf --read0 --reverse --bind 'enter:become(nvim {})' - end - end -else - function ee - if [ (count $argv) -eq 0 ] - fzf --reverse --bind 'enter:become(vim {})' - else - find $argv[1] -type f -print0 | fzf --read0 --reverse --bind 'enter:become(vim {})' - end +if [ -n $has_fd ] + set -gx FZF_DEFAULT_COMMAND "fd --type f --strip-cwd-prefix --hidden --exclude .git" +end + +function ee + if [ (count $argv) -eq 0 ] + set selection (fzf --reverse) + else + set selection (find $argv[1] -type f -print0 | fzf --read0 --reverse) end + commandline --replace "e $selection" + commandline --function execute end function terraform |
