I have multiple file open in Vim. When i want to switch from one file to another Vim does not allow me to switch unless I save the file or quit. Is there a way such that I do not have to save everytime when I want to switch? Is this a problem with Vim or am I making a mistake? If that’s the way Vim works can anyone tell me the logical reason?
Share
Just add
to your
~/.vimrc. It makes it possible to have multiple unsaved files open at all times.While you are at it, you should add this line as well:
It forces Vim to jump to an already open buffer where it is (right there, in another split-window, in another tab) instead of “hiding” the current buffer to replace it with the target buffer. This is useful for quickfix-related jumps but also for
:sb.These two lines are the key to use Vim’s buffers efficiently.