Skip to content

Instantly share code, notes, and snippets.

@heroheman
Last active May 25, 2026 11:32
Show Gist options
  • Select an option

  • Save heroheman/aba73e47443340c35526755ef79647eb to your computer and use it in GitHub Desktop.

Select an option

Save heroheman/aba73e47443340c35526755ef79647eb to your computer and use it in GitHub Desktop.
Ranger Cheatsheet

Ranger Cheatsheet

General

Shortcut Description
ranger Start Ranger
Q Quit Ranger
R Reload current directory
? Ranger Manpages / Shortcuts

Movement

Shortcut Description
k up
j down
h parent directory
l subdirectory
gg go to top of list
G go t bottom of list
J half page down
K half page up
H History Back
L History Forward
~ Switch the view

File Operations

Shortcut Description
<Enter> Open
r open file with
z toggle settings
o change sort order
zh view hidden files
cw rename current file
yy yank / copy
dd cut
pp paste
/ search for files :search
n next match
N prev match
<delete> Delete

Commands

Shortcut Description
: Execute Range Command
! Execute Shell Command
chmod Change file Permissions
du Disk Usage Current Directory
S Run the terminal in your current ranger window (exit to go back to ranger)

Tabs

Shortcut Description
C-n Create new tab
C-w Close current tab
tab Next tab
shift + tab Previous tab
alt + [n] goto / create [n] tab

File substituting

Shortcut Description
%f Substitute highlighted file
%d Substitute current directory
%s Substitute currently selected files
%t Substitute currently tagged files

Example for substitution

:bulkrename %s

Marker

Shortcut Description
m + <letter> Create Marker
um + <letter> Delete Marker
' + <letter> Go to Marker
t tag a file with an *
t"<any> tag a file with your desired mark

thx to the comments section for additional shortcuts! post your suggestions there!

@msanchezpolanco
Copy link
Copy Markdown

tag a file with your desired mark: t"<any> should be "<any>

@kachidk
Copy link
Copy Markdown

kachidk commented Apr 27, 2024

<delete> doesn’t delete files in v1.9.3

@webgtx
Copy link
Copy Markdown

webgtx commented Apr 29, 2024

doesn’t delete files in v1.9.3

Confirmed, if somebody knows why. Share the resources, or open the issue please. :shipit:

@GUNGODD
Copy link
Copy Markdown

GUNGODD commented Jun 23, 2024

Can anyone tell me how to open file Dir with kitty or other terminals, expect default gnome terminal
let e.g. .. /DIR/subdir/... and now I want to open this fire Dir with nvim using kitty

@Mik-813
Copy link
Copy Markdown

Mik-813 commented Aug 4, 2024

"t"<any> tag a file with your desired mark"
It is not t"<any> it's just "<any>

@coufal
Copy link
Copy Markdown

coufal commented Aug 10, 2024

Here is how you can fix the delete key:

edit .config/ranger/rc.conf and add this line

map <delete> delete

iirc mac users were complaining because they kept hitting delete by accident and thus the defaults were changed

@Kiameow
Copy link
Copy Markdown

Kiameow commented Dec 1, 2024

dD invoke console ": delete", then hitting enter will do the deletion.
you can change the line map dD console delete to map dD delete in .config/ranger/rc.conf file to skip the enter step ;)

@gajakananoa-Raja
Copy link
Copy Markdown

@loup-brun
Copy link
Copy Markdown

Is there a way to type shell commands and show the output?

@GiorgosChr I found that running a command, then piping the result to an interactive pager like less allows to view the output. Quitting the pager then returns to ranger.

For example, display a zip file’s contents (assuming it is highlighted in ranger, %f = current file, e.g. archive.zip):

:shell unzip -l %f | less

Inspect the listed files through less (or your favourite $PAGER), and finally press q to quit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment