Skip to content

Instantly share code, notes, and snippets.

@ktravis
Created August 6, 2013 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ktravis/6169039 to your computer and use it in GitHub Desktop.
Save ktravis/6169039 to your computer and use it in GitHub Desktop.
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