Whenever I make a new directory, copy, a file, etc. using netrw's mt mf mc
commands (for example), or just d
, my vim gets into a state where it will absolutely, by no means (known to me) be exited from.
Even if I try to type q!
from the netrw directory view, I get:
E37: No write since last change
E162: No write since last change for buffer
Literally all I am left with doing is killing my terminal process.
Assuming I can't change the permissions in this environment. What options am I left with? Completely avoiding netrw for managing directories?
And I'm always seeing this kind of thing after editing files:
"NetrwTreeListing 1" [Not edited][readonly]
netrw creates and modifies hidden buffers.
A way out of the situation might be
autocmd FileType netrw setlocal bufhidden=delete
That can be placed in ~/.vimrc, then q! will let you out after netrw work.
This is via Tim Pope, https://github.com/tpope/vim-vinegar/issues/13#issuecomment-47133890 but there are other comments in that thread that that setting may not always work. Works here, but that is probably luck, very light newrw usage, and not bumping into some bufhidden on/off edge case yet.
That autocmd setting might delete a hidden modified buffer that means something someday, so take this as unexpert sledge hammer advice, no warranty expressed or implied.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With