|
From: | ping |
Subject: | [Ranger-users] ranger: bash code example in man page doesn't work |
Date: | Wed, 05 Dec 2012 12:34:17 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 |
I want to have range to continue exactly where I left off when re-run, but these code from the man page seems doesn't work. Bash: cd to last path after exit This is a bash function (for ~/.bashrc) to change the directory to the last visited one after ranger quits. You can always type "cd -" to go back to the original one. I put these into my .bashrc function ranger-cd { tempfile='/tmp/chosendir' /usr/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}" test -f "$tempfile" && if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then cd -- "$(cat "$tempfile")" fi rm -f -- "$tempfile" } # This binds Ctrl-O to ranger-cd: bind '"\C-o":"ranger-cd\C-m"' am I missing anything here? |
[Prev in Thread] | Current Thread | [Next in Thread] |