I frequently use :e. to navigate folders and open files in gVim. But later, when I try to close the session with a :qall, I am asked by vim whether or not I want to save changes to the folder(s) I was navigating with netrw. I couldn't save such changes, even if checked yes.

What do I add to my vimrc to let Vim know that I never want to save changes to a directory?

(I'm using gVim on Windows 7.)

Edit: I tried this, to no avail:

let g:netrw_dirhistmax=0
  • g:netrw_dirhistmax is used to specify how much history you want netrw to keep about (see :help netrw-u, for example). It has nothing to do with however you changed a netrw buffer.
    – user21497
    Nov 24 '15 at 19:34

You could try setting the buftype option. E.g. doing :set buftype=nofile should make ignore that buffer.

But I'am wondering how you could modify this buffer, since this should read-protected and not-modifiable.

  • I know this is super old, but I thought I'd just add that I tried setting buftype=nofile and for some reason that doesn't work either. Not sure what's causing the buffer to get "edited" but it super annoying and I can't find a good fix for this.
    – Tumbler41
    Dec 8 '16 at 16:34

There are several solutions discussed here: https://github.com/tpope/vim-vinegar/issues/13

I found this command to work for my setup:

autocmd FileType netrw setl bufhidden=delete

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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