Skip to content

Instantly share code, notes, and snippets.

@ktravis
Created Aug 6, 2013
Embed
What would you like to do?
reel is an "up" command for fish, inspired by reddit.
function reel
if test -f $argv[1]
cd ..
else
if pwd | grep -q "$argv[1]"
set x (dirname $PWD)
while test -z (echo (basename $x) | grep "$argv[1]")
set x (dirname $x)
end
cd "$x"
else
echo "Directory name containing "$argv[1]" was not found in current path."
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment