Skip to content

Instantly share code, notes, and snippets.

@ashwin
Created September 28, 2014 13: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 ashwin/8d64074bbe2296818929 to your computer and use it in GitHub Desktop.
Save ashwin/8d64074bbe2296818929 to your computer and use it in GitHub Desktop.
Change directory in fish after closing Ranger
# Add this to your ~/.config/fish/config.fish
function ranger-cd
set tmpfile "/tmp/pwd-from-ranger"
ranger --choosedir=$tmpfile $argv
set rangerpwd (cat $tmpfile)
if test "$PWD" != $rangerpwd
cd $rangerpwd
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment