📅 2013-Aug-26 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ preview, ranger, ubuntu ⬩ 📚 Archive
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
j and 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
a user of vim.
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!
https://www.youtube.com/watch?v=E9LCsGWYuiE
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:
$ git clone https://github.com/hut/ranger.git
$ 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 directoryDel: Delete selected files and directoriess: Open shell in current directoryCtrl + n: Open new tabTab: Switch to next tabCtrl + w: Close tabgh: Go to home directorygr: Go to root directorygm: Go to media directorycw: Rename current file or directoryzh: Show hidden files and directoriesdc: Compute size of directory under cursor. Size is
displayed in status line at bottom.When you are operating on files:
Enter: Open in default program.i: Open in pager.r: Open witho: Change sort orderSpace: Select/unselect current fileTried with: Ranger 1.5.2 and Ubuntu 12.04