Ranger

1 Feb 2018

Every now and then I search and tinker with TUIs1 that optimize my development workflow. I’m one of those guys now who tells everyone to spend one or two weeks on setting up a fast & useful workflow before starting to code. This post talks a little about a tool called ranger : a command-line tool for faster navigation & my love at first-sight ♥


Ranger is a file explorer for command line with (configurable) vim-like keybindings. Which means you can cd, cut, copy, paste, rename, open files, change permissions & do a whole lot of other operations while being inside terminal with easy to use ncurses based interface & mnemonic2 keybindings!

Installation :

  • If you use Arch Linux, you can get it from yaourt : open terminal and execute yaourt ranger and pick either ranger from community or ranger-git from aur.

  • Otherwise follow instructions from their git repository.

General Instructions :

  • To start : Open your terminal and type ranger.
  • Press Q to quit.

Ranger Introduction

  • Press ? for manpages and shortcuts.
  • Press R to reload current directory (not really required most of the time).
  • Every keybinding mentioned below is configurable.
  • Tab completion is supported.

Basic Usage :

Movement

  • Quick navigation while being inside terminal :
  • You can use arrow keys ← ↑ → ↓ or vim-like h j k l to navigate.

Ranger Movement

  • ← or h will take you to parent directory of current directory.
  • → or l will take you to sub-directory of current directory.
  • Press gg to go to top of list and G to go to bottom.

File Operations

  • To copy or yank a single file, press yy or F5 or type :copy when it is highlighted.
  • To cut a single file, press dd or F6 or type :cut when it is highlighted.
  • Paste file(s) with pp or type :paste. If you paste files with same name, it’ll rename to avoid same names.

Ranger Movement

  • You can overwrite while pasting if you don’t want to rename by using po instead of pp.
  • To delete a file, use dD or F8 or :delete.

  • To operate on multiple files, you’ll have to mark them first at a time with SPC key or you can also mark multiple at once with SHIFT + V + (↑ ↓) and then proceeed as usual with dd / :cut for cut, yy / :copy for copy, dD / :delete for delete.

  • To rename a file or folder, you can use cw which corresponds to change word in vim. Or you can simply use the command :rename <new name>.

  1. Text-based user interface (TUI), also called textual user interface or terminal user interface, is a retronym coined sometime after the invention of graphical user interfaces. TUIs display computer graphics in text mode. An advanced TUI may, like GUIs, use the entire screen area and accept mouse and other inputs. ↩

  2. Mnemonic : A pattern of letters which assists in remembering something. ↩



❮
Blog
❯