
For a list of BASHing data 2 blog posts see the index page.
Two more tweaks for the ranger file manager
In 2024 I blogged about some useful tweaks for ranger. See that post for background and tweaking methods. As I've grown more accustomed to this remarkably powerful file manager I've tweaked a bit more, as explained below. I'm still running ranger 1.9.3 in sakura terminal emulator.
Wrap long lines in text previews. The default Boolean value is "false" for set wrap_plaintext_previews in the system "rc.conf", which is deeply buried in /usr/lib/python3/dist-packages/ranger/config/. I added the line
set wrap_plaintext_previews true
to my own "rc.conf", which lives in ~/.config/ranger. These screenshots show the difference; they're grabbed from a much-reduced ranger window for clarity:
unwrapped

wrapped

Fix color problem in sakura. When ranger runs in sakura it applies its own color scheme but accepts the sakura background color, which I've set as an easy-on-the-eyes #E6E6DC. Unfortunately, that means the lighter ranger colors in the default color scheme don't show up very well:

The default colorscheme in ranger is "default.py" and is stored in /usr/lib/python3/dist-packages/ranger/colorschemes/. In "default.py", most text is black but folder names are blue, which is OK with me. I created a new folder "colorschemes" in ~/.config/ranger and copied "default.py" there. I renamed the file "mycolors.py" and using a text editor replaced the words "cyan", "green" and "yellow" in the file with "black". In my "rc.conf" I added the line
set colorscheme mycolors
My visibility problem was fixed:

Invaluable keystrokes. These aren't tweaks, they're my discoveries of handy keyboard commands already available in ranger. They're not as hard to remember (for me) as the dozens of other available keyboard shortcuts and commands, and these get used regularly.
i - toggle expanding the preview pane to occupy the whole ranger window
zh - toggle listing the hidden dotfiles
cw - rename a file or folder
@ - launches a "blank" shell command at lower left in the ranger window, with the cursor just before the selected file or folder, which is represented by "%s"
Next post:
2025-05-16 Multiple-line records to a simple table
Last update: 2025-05-09
The blog posts on this website are licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License