How to refresh or reload rc.conf in ranger file manager

ranger

At the moment I am constantly changing the rc.conf and rifle.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.

Best Answer

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.

Related Question