ranger - file manager

Documentation

Frequently Asked Questions

Ranger crashes after upgrading
You probably have commands in your ~/.config/ranger/commands.py or rc.conf that rely on the internals of the previous ranger version. Try running "ranger --clean" to start ranger in a mode that skips loading configs. If everything works, you have to either delete or update your current configuration files to run ranger normally.

How to avoid broken configuration files when upgrading?
The configuration interface is stable for versions with the same minor version number (for example, 1.6.0, 1.6.1, 1.6.2, ...) but if you upgrade from, for example, 1.6.0 to 1.7.0, the configs will not be 100% compatible anymore. Here are hints on how to avoid compatibility issues.

Generally, remove configuration files that you don't need. ranger will simply load the default configuration files and you will have no compatibility problems with them.
rc.conf, commands.py
These files are loaded on top of the default config, so keep them minimal; they should only have commands that you added yourself. Use the defaults only as guidelines, because if you copy the whole default config file, it will be out of date when you upgrade.
A minimal commands.py needs at least this line a the top:

from ranger.api.commands import *

rifle.conf, scope.sh
Don't copy them into your config directory if you don't want to modify them. If you do, make sure to check them if you experience problems after upgrading to another minor version number.

colorschemes, plugins
Check them when upgrading to another minor version number.

The preview of code files is empty when using scope.sh on Linux Mint
You probably need to change the program call for "highlight" to "/usr/bin/highlight" in your scope.sh, because Linux Mint ships with another, completely unrelated "highlight" program which scope.sh ends up using. See http://forums.linuxmint.com/viewtopic.php?t=122220#p686532

How to extract archives?
You need the program "atool" which handles extraction of all sorts of archives automatically. Then, open the archive file in ranger "with the mode 1". You can read about "modes" in the man page, the short answer is that you have to select the archive file and type "1l" or "1<Enter>". Newer ranger versions can display a list of all possible modes if you press "r".

How to change the editor which opens text files?
In your shell rc file, add:

export EDITOR=emacs

How to change the program which opens file type XYZ?
Ranger has a configuration file which contains instructions on how to do that. It can be obtained by running "ranger --copy-config=rifle" and it will be copied to ~/.config/ranger/.

How to change or add key bindings?
Since ranger 1.5.0, key bindings are defined in the configuration file rc.conf which can be obtained with "ranger --copy-config=rc". The file should be self-explanatory.

How to use a trash bin instead of deleting files permanently?
That is not supported by default, but you can add this simple command to your ~/.config/ranger/rc.conf, then type X to trash a file:

map X shell mkdir -p ~/.trash; mv -bv %s ~/.trash/

How to view all image files in feh/sxiv starting with the current file? (ranger 1.6)
You'll have to modify the rifle.conf:
With feh, you can use the --start-at option and add a line to rifle.conf like:

ext png|bmp|gif|jpe?g, X, flag f = feh -FZx *.bmp *.jpg *.png *.gif *.jpeg --start-at "$(basename "$1")"

With sxiv, you can use this script. It contains further instructions.

Why is my question not in this list?
Probably because I forgot about it. Or it wasn't asked yet. Either way, you can fix this by asking your question.