Skip to content

ranger file manager: change default behaviour to opening a file with less

The ranger file manager is really great to navigate fast and look at files.

The default action (enter or right) for a file is open, so text files will be opened with a text editor.

I understand that i can probably change the EDITOR variable for ranger to less, but then how would i edit files when i want?

6 points2 comments
Open on Reddit
About this post
Posted
Archived
Score
6 · 100% up
Kind
Text
ID
2cpu96

Author

27
posts
1.3k
comments
5
media
View profile

2 comments

You can remap the keys. See:

$ man ranger

For a starting point, take a look at:

/usr/share/doc/ranger/config/rc.conf

Alternatively, review ranger's file opener:

$ man rifle
2 points

man ranger

You sir are nicer than I, I was tempted to ask RTFM? I mean if he's into ranger file manager he MUST be familiar with man pages. Right? Right?

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.