Last Updated on September 23, 2022 by shibatau
VI is added.
I. What is Ranger?
It reads at https://github.com/ranger/ranger:
ranger is a console file manager with VI key bindings. It provides a minimalistic and nice curses interface with a view on the directory hierarchy. It ships with rifle, a file launcher that is good at automatically finding out which program to use for what file type.
II. How to install Ranger
1.Run the following command in the terminal.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 2> /dev/null
2.Run the following command in the terminal. You have to install Homerew beforehand.
brew install ranger
You can learn more here:
III. Enable Image Preview in Ranger
1.Create a rc.conf file
cd ~/.config/ranger && touch rc.conf
Open the rc.conf file with Nvim (or your favorite editor):
Add the following two lines to the rc.conf file:
set preview_images true set preview_images_method kitty
Install the Pillow library using Pip
pip install Pillow
Open ranger with the following command in the terminal.
IV. How to use Ranger
You can learn how to use from here:
You can execute shell commands from the terminal with : For example, you can delete files with trash-cli with :shell trash-put file_name1 file_name2 if you have installed it.
V. If Preview doesn’t work
1. Replace the path with the correct path to the Python used with Ranger in ranger.py as suggested in the post:
2.Set ranger.py via ranger
This has worked for me. You can enter Command Mode with : in Ranger in the same way as Vim editor.
ranger --cleanin the terminal
:set preview_images truein Ranger
:set preview_images_method kittyin Ranger
VI. If Ranger freezes on particular files on Mac
I have delete ranger installed via Homebrew and install it with Pip:
pip install ranger-fm
But Ranger freeze when hovering certain files as before and even Ctrl+c doesn’t work at all.
You can avoid freezing if you take time enough to show texts or a image when you move from a file to another one.
Probably you can fix this by changing scope.sh. I use miniconda on Mac and the scope.sh and the file is located in /Users/MYNAME/opt/miniconda3/lib/python3.9/site-packages/ranger/data. I have not changed anything yet. If you want, you can get some information on that here: