I cannot exit vim even when I type :q!. I get the error

E37: No write since last change (add ! to override)
E162: No write since last change for buffer...

I think the buffer is a NetrwTreeListing readonly.

  • I noticed this happens in particular after using the x:special command within the netrw directory listing. May 25, 2020 at 10:26

3 Answers 3


To solve this nuisance with netrw permanently, I added this to my .vimrc:

" Per default, netrw leaves unmodified buffers open. This autocommand
" deletes netrw's buffer once it's hidden (using ':q', for example)
autocmd FileType netrw setl bufhidden=delete

From Tim Pope.


This usually happens, if there are two or more buffers which are modified and Vim then usually toggles between them and shows the error message. So when :q! would abort the current buffer, it wouldn't not abort the other modified buffer, so therefore Vim protects you from losing changes and gives this error message.

If you are absolutely sure, you want to abort all modifications to all loaded buffers, then simply use :qa!






for short. This stands for "buffer delete" and will close the buffer you have open. (Credit goes to Emil Asmussen)

After that, you should be able to do :q! as normal.

  • 2
    Ok, but why is it not letting me quit? May 21, 2016 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.