mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2024-11-10 23:30:57 +00:00
Add z -
support to fish
This commit is contained in:
parent
6d91b4e3c4
commit
01f21400e4
@ -1,13 +1,22 @@
|
|||||||
function z
|
function z
|
||||||
if test (count $argv) -gt 0
|
set -l argc (count $argv)
|
||||||
set _Z_RESULT (zoxide query $argv)
|
if test $argc -gt 0
|
||||||
switch "$_Z_RESULT"
|
if test $argc -eq 1 -a "$argv[1]" = "-"
|
||||||
case 'query: *'
|
cd -
|
||||||
cd (string sub -s 8 -- "$_Z_RESULT")
|
commandline -f repaint
|
||||||
commandline -f repaint
|
else
|
||||||
case '*'
|
set _Z_RESULT (zoxide query $argv)
|
||||||
echo -n "$_Z_RESULT"
|
switch "$_Z_RESULT"
|
||||||
end
|
case 'query: *'
|
||||||
|
cd (string sub -s 8 -- "$_Z_RESULT")
|
||||||
|
commandline -f repaint
|
||||||
|
case '*'
|
||||||
|
echo -n "$_Z_RESULT"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
cd ~
|
||||||
|
commandline -f repaint
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user