.config/fish/functions/fzvim.fish
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function fzvim --description 'Picks file path with fzf and opens in $EDITOR'
set -f file_path "$(fzf)"
if test -f "$file_path"
echo "Editing $file_path..."
$EDITOR "$file_path"
else if test "$file_path" = "" # no entries chosen from fzf
: # do nothing
else
echo "$file_path not found."
end
end
|