Ranger is a file manager for the shell with vi keybindings. Its interface is similar to the Finder in Mac OS X. You can move up and down files or directories in the current path by pressing
k. To move to parent directory use
h and to open the directory or file currently highlighted press
l. These navigation keys should be very intuitive for the vim user.
Ranger can also utilize many other tools to show previews of many types of files. This is really useful because you can see previews of source code, contents of zip files, text inside PDF files and even ASCII rendering of image files (JPG/PNG) all from inside ranger in color!
If you like the previews, first install those relevant tools, followed by ranger from the Ubuntu repositories:
$ sudo apt install highlight atool w3m poppler-utils caca-utils $ sudo apt install ranger
The version of Ranger in Ubuntu can be pretty old. To install the latest Ranger from source:
- Download the latest Ranger source code from Github here:
$ git clone https://github.com/hut/ranger.git
- Build and install:
$ cd ranger $ sudo make install
Run ranger once so that it creates its default configuration directory in
~/.config/ranger. After that run ranger so that it copies over its configuration files to this location. This is necessary to configure ranger or for it to enable previews.
$ ranger $ ranger --copy-config=all
After this you are good to go: enjoy navigating around your directory and seeing colorful previews of all your files, right in your shell! 🙂
Space: Select current file or directory Del: Delete selected files and directories S: Open shell in current directory Ctrl+n: Open new tab Tab: Switch to next tab Ctrl+w: Close tab gh: Go to home directory gr: Go to root directory gm: Go to media directory cw: Rename current file or directory zh: Show hidden files and directories dc: Compute size of directory under cursor. Size is displayed in status line at bottom. On files: Enter: Open in default program. i: Open in pager. r: Open with o: Change sort order Space: Select/unselect current file
Tried with: Ranger 1.5.2 and Ubuntu 12.04