Ranger - A Very Efficient CLI File Manager
You'll especially appreciate the ranger file manager if you are a touch typist, and/or a user of the vi or vim text editor, as along arrow keys, it utilizes the h, j, k, and l keys for rudamental navigation, among others!
Show more navigational key bindings that overlap with vi(m) text editor's
Ctrl-U, Ctrl-D - move a half page down, up
gg, G - move to the top, bottom
/ - search
n, N - finding the next, previous files
Bookmarking
Some Key-Bindings I've Found Particularly Useful
One feature I'm pretty sure you would like to have is that when you exit ranger, it would change the current directory of the shell to the one that was lastly viewed in the file manager.
Luckily for you there's a shell function that makes it possible. I think I've found it at the http://manpages.ubuntu.com/manpages/precise/man1/ranger.1.html long time ago, here it is:
For bash
ranger-cd() {
tempfile='/tmp/chosendir'
/usr/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}"
test -f "$tempfile" &&
if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
command cd -- "$(cat "$tempfile")"
fi
rm -f -- "$tempfile"
}
# This binds Ctrl-O to ranger-cd:
bind '"\C-o":"ranger-cd\C-m"'
For zsh
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
}
# This binds Ctrl-O to ranger-cd:
bindkey -s '^O' 'ranger-cd^M'
Because the given pieces of code also bind the Ctrl-O to execute the newly created ranger-cd shell function, after sourcing the file you've put the function in, you can open ranger with no time, great!