LLI Wiki — My Digital Knowledge Base

Ranger terminal file manager: settings and shortcuts

rc.conf settings and shortcut cheat sheet for ranger.

Ranger is a keyboard-driven file manager for the terminal. This note lists useful configuration tweaks and the most common shortcuts.

Configuration

The local configuration file is ~/.config/ranger/rc.conf.

Goal How
Show hidden files set show_hidden true in rc.conf, or press zh while running
Show modification time :linemode mtime or :linemode sizemtime (recent ranger versions)
Disable the mouse In rc.conf, change set mouse_enabled true to false

General

Shortcut Description
ranger Start Ranger
Q Quit
R Reload current directory
? Help and shortcuts

Movement

Shortcut Description
k / j Up / down
h Parent directory
l Enter directory
gg / G Top / bottom of the list
J / K Half page down / up
H / L History back / forward
~ Switch the view

File operations

Shortcut Description
Enter Open
r Open with
z Toggle settings
o Change sort order
zh View hidden files
cw Rename current file
yy Yank (copy)
dd Cut
pp Paste
dD Delete
u Undo
/ Search for files (:search)
n / N Next / previous match
i Preview file

Commands

Shortcut Description
: Run a ranger command
! Run a shell command
chmod Change file permissions
du Disk usage of the current directory
S Open a shell in the current directory (exit to return to ranger)

Tabs

Shortcut Description
Ctrl+n New tab
Ctrl+w Close current tab
Tab / Shift+Tab Next / previous tab
Alt+[n] Go to or create tab n

Substitution in commands

Token Replaced by
%f Highlighted file
%d Current directory
%s Selected files
%t Tagged files

Example: :bulkrename %s

Markers and tags

Shortcut Description
m + letter Create a marker
um + letter Delete a marker
' + letter Go to a marker
t Tag a file with *
t"<any> Tag a file with a custom mark
Mastodon LLIMastodon SocialFosstodon