How to change the default document viewer in ranger?
For text files rifle (ranger's file opener) uses your default $EDITOR
. You can set it to vim by adding the line export EDITOR=vim
to your ~/.bashrc
or equivalent.
For other file types you can configure rifle with the file ~/.config/ranger/rifle.conf
. First copy the defaults with ranger --copy-config=rifle
. Then rearrange the programs (or add more) in the appropriate section so that your preferred application is at the top.
Related videos on Youtube
PatrickSteiner
Preferred OS: Linux Mint 18.3 Sylvia Occupation: Computer Science Student
Updated on September 18, 2022Comments
-
PatrickSteiner almost 2 years
How do I change the default document viewer in the file-manager "ranger"?
By pressing [R] it is only possible to choose how to open the document for this one time, but the choice will not be safed. E.g. my default viewer for plain text files is "nano", but i want it to be "vim" as default.
-
PatrickSteiner about 6 yearsIn
~/.config/ranger/rifle.conf
i addedext c|cpp|txt|md = vim "$@"
in the first line andext c|cpp|txt|md = atom "$@"
in the second line, to use atom as my alternative editor. So it worked, thanks!