Logo
Overview
Ranger manager configure

Ranger manager configure

August 5, 2020
2 min read
index

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

OSArch Linux
FontIosevka 14
TerminalTermite
WMi3

Ranger icons

Install

Terminal window
git clone https://github.com/alexanderjeurissen/ranger_devicons ~/.config/ranger/plugins/ranger_devicons

Then execute the following:


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

Configure spacing between icon and text:

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


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.


Add syntax highlighting preview

Just install highlight package:

  • Arch:
Terminal window
$ sudo pacman -S highlight

  • Ubuntu:
Terminal window
$ 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.


Image preview

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

Terminal window
yay -S python-ueberzug-git

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

set preview_images_method ueberzug


File management

ShortcutsDescription
HShow hidden files and folders.
rOpen with <APPLICATION>.
DDelete the marked file or the selected files.
<Space>Selects the current file/folder.
vMarks all files and folders in the current directory.
aEdit the name of the file/folder by putting the cursor last.
IEdit the name of the file/folder by putting the cursor first.
cwChange the name of the file/folder.
oSort 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.
:bulkrenameLets you bulk rename the selected files and folders by using your $EDITOR.