Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh netrw buffer after changes #47

Open
wickedshimmy opened this issue Dec 16, 2014 · 4 comments
Open

Refresh netrw buffer after changes #47

wickedshimmy opened this issue Dec 16, 2014 · 4 comments

Comments

@wickedshimmy
Copy link

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

@tpope
Copy link
Owner

tpope commented Dec 16, 2014

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.

@wickedshimmy
Copy link
Author

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

@tmillr
Copy link

tmillr commented Sep 14, 2022

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

@unrealapex
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants