Create a gist now

Instantly share code, notes, and snippets.

@chanux /za.fish
Last active Nov 12, 2015

Fish shell port of za
function za
## Fish shell port of za https://gist.github.com/chanux/1119556
## What The Fish? : http://wp.me/p1rVu-bO
##
## To use za as a Fish function, just copy paste the script and enter
## Then run func_save za
## Now you can use za on your Fish <"><
if [ -z $argv[1] ]
set za_mark 1
else
set za_mark $argv[1]
end
set za_dir $PWD
# When in home, do nothing
[ $za_dir = $HOME ]; and return
while [ $za_mark -gt 0 -a $za_dir != $HOME ]
set za_dir (dirname $za_dir)
set za_mark (math $za_mark - 1)
end
cd $za_dir
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment