vim-vinegar icon indicating copy to clipboard operation
vim-vinegar copied to clipboard

Refresh netrw buffer after changes

Open wickedshimmy opened this issue 10 years ago • 4 comments

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).

wickedshimmy avatar Dec 16 '14 03:12 wickedshimmy

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.

tpope avatar Dec 16 '14 04:12 tpope

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 :/

wickedshimmy avatar Dec 16 '14 05:12 wickedshimmy

On the contrary, I really wish netrw refreshed/updated buffers (kinda like fugitive does) after moving or removing files or dirs.

tmillr avatar Sep 14 '22 11:09 tmillr

<C-l> also refreshes Netrw, though not automatically as you have hoped. @wickedshimmy if your issue is solved, perhaps you should close this issue?

unrealapex avatar Jan 04 '23 07:01 unrealapex