Avatar

Hund[en]

Linux, plaintext & minimalism
July 30, 2020

How to visually hide files and folders in Ranger

Most users are probably already familiar with the common way to hide files and folders in Linux based operating systems, which is by adding a dot to the beginning of the file or the folder.

That is not always a desirable solution and sometimes not even an option. One example would be the folder ~/Desktop for me, it’s a folder that I never use. I don’t even have a “desktop” to begin with, but I can’t just hide it by renaming it to “.Desktop”. If I did it would just be recreated.

With the help of the plugin plugin_file_filter.py it’s possible to visually hide files and folders you don’t want to see. If you want to temporarily view the hidden files and/or folders again you can just temporarly set the setting show_hidden to true.

Installation

Start by creating the folder ~/.config/ranger/plugins/:

$ mkdir ~/.config/ranger/plugins/

Save the script to the newly created folder. In the script you then have this part:

HIDE_FILES = ("/boot", "/sbin", "/proc", "/sys")

Edit that part to your liking and just restart Ranger for the changes to take effect.

Tags: Ranger | File management | Applications & Tools

Advertising

Feedback

I don't have a commenting system simply because I haven't found an ethical option that I like. If you want to leave any feedback and/or have any questions, feel free to contact me via e-mail, the fediverse or via IRC (I'm Hund at freenode).