How to refresh or reload rc.conf in ranger file manager?
Solution 1
Here is a tricky way to do this, and this may not always work if they change their code (and there could be cases where restarting ranger
is better/safer).
rc.conf
In ranger
, assuming you have a custom rc.conf
in ~/.config/ranger/rc.conf
, type:
:eval fm.source(fm.confpath('rc.conf'))
I tested this by changing set draw_borders true/false
in ~/.config/ranger/rc.conf
.
rifle.conf
In ranger
, assuming you have a custom rifle.conf
in ~/.config/ranger/rifle.conf
, type:
:eval fm.rifle.reload_config()
Note that this was tested with the latest Git commits.
Solution 2
https://github.com/ranger/ranger/wiki/Keybindings#quick-editing-rcconf says that you can use this to quickly edit the rc.conf
file and source it once saving it:
map xx chain shell vim -p ~/.config/ranger/rc.conf; source ~/.config/ranger/rc.conf
and this works for scope.sh
:
map xr chain shell vim -p ~/.config/ranger/scope.sh; source ~/.config/ranger/scope.sh
this is works for rifle.conf
map xr chain shell vim ~/.config/ranger/rifle.conf; eval fm.rifle.reload_config()
I'll update this reply once I know the correct configuration for commands.py
. If anyone knows, please edit this.
![milarepa](https://i.stack.imgur.com/iWwvw.jpg?s=256&g=1)
milarepa
Updated on September 18, 2022Comments
-
milarepa almost 2 years
At the moment I am constantly changing the
rc.conf
andrifle.conf
files, but every time I want to test the new configuration I need to exit ranger and start again.Is there a solution for this?
In vim I use
:source ~/.vimrc
to reload the configuration file, but this doesn't work in ranger. -
Matthias Braun over 5 yearsThis part of ranger's source code loads
commands.py
. I wasn't able to call those functions fromrifle.conf
, though.