rnvimr
rnvimr copied to clipboard
macOS: RnvimrToggle: workaround for ranger "falling asleep" after a long time
Hi, thank you very much for this great plugin that I use every day. I love how well integrated with vim it is, wiping buffers associated with deleted files, renaming, etc. All in all a joy to use :heart: This is just about a workaround I found for a macOS specific annoyance that am wondering if you'd be ok with adding to the Q&A section.
Basically, the issue is like this:
- open nvim
- execute
:RnvimrToggleand close the popup window (I havelet g:rnvimr_enable_picker = 1) - If I do
:RnvimrToggleagain at this point it shows up instantly. - Close popup and wait a while, leaving nvim open (potentially doing work inside but not re-opening ranger). I am not sure how long it is exactly, maybe 20-30min
- invoke
:RnvimrToggleagain. It takes like 5s to load.
In my case, I found that the ranger process spawned by rnvimr` has a nice level of 32. Changing this setting so that it has nice level 0 (lower is better) seems to fix it for me:
let g:rnvimr_ranger_cmd = 'nice -n 0 ranger'
This is probably only an issue on macOS. I am not sure if other operating systems have this kind of aggressive "putting to sleep" of unused processes ... but maybe worth a note in the Q&A as it's something that can break your flow.
Thanks for your feedback. It is seemly renice by your OS.
Unfortunately, I can't reproduce it and don't have any idea why your nice of ranger will be greater than 20.
I leave this issue as information for those who encounter this similar situation.