vim-vinegar
vim-vinegar copied to clipboard
Refresh netrw buffer after changes
vinegar has been a minor revolution in my vim usage (so: thanks!), not least because it often alerts me to random garbage in my filesystem, and I am somewhat obsessive about things like that. I use the excellent !
mapping to delete that garbage -- but after doing so the buffer is then out-of-sync with the actual directory, which confuses me, because I am feeble-minded. Would you accept a patch that refreshes the directory after a :cmd
execution? (My assumption is that it's not a remotely expensive thing to do, of course).
Hmm, surprised it doesn't already. I guess it would be okay, as long as it doesn't leave me responsible for any more netrw bugs.
So, the normal netrw facility for deleting files (D
in the buffer, which I have just discovered because I am a clown) does refresh, and it seems to manage the refresh using some script-local functions that probably shouldn't be duplicated but are largely impenetrable to me anyways (https://github.com/vim-scripts/netrw.vim/blob/master/autoload/netrw.vim#L6013-L6040).
Just doing that solves my narrow complaint, but I suppose there are still a whole class of cmds where this would be an issue. Something like autocmd <buffer> ShellCmdPost :e!
would seem to blunt-hammer everything out of the way but might be bad for remote netrw buffers (I can't say I use them). Worth digging into the general case?
Sorry for the noise :/
On the contrary, I really wish netrw refreshed/updated buffers (kinda like fugitive does) after moving or removing files or dirs.
<C-l>
also refreshes Netrw, though not automatically as you have hoped. @wickedshimmy if your issue is solved, perhaps you should close this issue?