Ranger manager configure

My personal ranger config

Warning
This article was last updated on 2022-04-10, the content may be out of date.

This is my personal config for the ranger file manager. Some basic information:

OS Arch Linux
Font Iosevka 14
Terminal Termite
WM i3
1
git clone https://github.com/alexanderjeurissen/ranger_devicons ~/.config/ranger/plugins/ranger_devicons

Then execute the following:


1
2
echo "default_linemode devicons" >> $HOME/.config/ranger/rc.conf
# (or wherever your rc.conf is located).

In ~/.config/ranger/plugins/ranger_devicons, edit the following file __init__.py:


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
import ranger.api
from ranger.core.linemode import LinemodeBase
from .devicons import *

@ranger.api.register_linemode
class DevIconsLinemode(LinemodeBase):
  name = "devicons"

  uses_metadata = False

  def filetitle(self, file, metadata):
    return devicon(file) + ' ' + file.relative_path

@ranger.api.register_linemode
class DevIconsLinemodeFile(LinemodeBase):
  name = "filename"

  def filetitle(self, file, metadata):
    return devicon(file) + ' ' + file.relative_path

In line return devicon(file) + ' ' + file.relative_path, add or delete spaces in ' ' to adjust the spacing between the icons and your file/folder name.


Just install highlight package:

  • Arch:
1
$ sudo pacman -S highlight

  • Ubuntu:
1
$ sudo apt-get install highlight

Then reopen ranger.

Ranger configures highlighting in scope.sh. To use a specific theme, the HIGHLIGHT_STYLE variable should be set, for example: export HIGHLIGHT_STYLE=clarity.


First, install python-ueberzug-git from aur by running this command:

1
yay -S python-ueberzug-git

In your ranger config file (~/.config/ranger/rc.conf), add this line:

set preview_images_method ueberzug


Shortcuts Description
H Show hidden files and folders.
r Open with <APPLICATION>.
D Delete the marked file or the selected files.
<Space> Selects the current file/folder.
v Marks all files and folders in the current directory.
a Edit the name of the file/folder by putting the cursor last.
I Edit the name of the file/folder by putting the cursor first.
cw Change the name of the file/folder.
o Sort current directory.oa to sort by time. osto sort by name size and so on.
'<LETTER> Jump to bookmark.
m<LETTER> Bookmarks the current directory.
:bulkrename Lets you bulk rename the selected files and folders by using your $EDITOR.