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 executeyaourt 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.
- 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-likeh j k l
to navigate.
←
orh
will take you to parent directory of current directory.→
orl
will take you to sub-directory of current directory.- Press
gg
to go to top of list andG
to go to bottom.
File Operations
- To copy or yank a single file, press
yy
orF5
or type:copy
when it is highlighted. - To cut a single file, press
dd
orF6
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.
- You can overwrite while pasting if you don’t want to rename by using
po
instead ofpp
. -
To delete a file, use
dD
orF8
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 withSHIFT + V + (↑ ↓)
and then proceeed as usual withdd
/:cut
for cut,yy
/:copy
for copy,dD
/:delete
for delete. - To rename a file or folder, you can use
cw
which corresponds tochange word
in vim. Or you can simply use the command:rename <new name>
.
-
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. ↩
-
Mnemonic : A pattern of letters which assists in remembering something. ↩