Add z - support to fish

This commit is contained in:
Klaus Alexander Seistrup 2020-03-10 23:51:08 +01:00 committed by GitHub
parent 6d91b4e3c4
commit 01f21400e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,10 @@
function z
if test (count $argv) -gt 0
set -l argc (count $argv)
if test $argc -gt 0
if test $argc -eq 1 -a "$argv[1]" = "-"
cd -
commandline -f repaint
else
set _Z_RESULT (zoxide query $argv)
switch "$_Z_RESULT"
case 'query: *'
@ -9,5 +14,9 @@ function z
echo -n "$_Z_RESULT"
end
end
else
cd ~
commandline -f repaint
end
end