I’m temporarily working on a different machine.
Every time I try and quit vim
:q!
after vim was started with more than one file on the command-line, vim is simply going to the next file.
I already copied my .vimrc into the home directory.
On both machines it is vim 7.4.
In case this was unclear:
I’m using vi/vim since 30 years and I always used the command I mentioned to quit. It never meant "go to the next file". So any answer that I suddenly need to use something different, needs to tell me, why it worked until now and why it still does on another machine.
2
Answers
No. Vim is not "ignoring
:q!
.From
:h :q
in Vim 7.4:Most likely you have hidden buffers turned on in this case of vim. That allows you to have multiple, unsaved files open (open files in vim are called buffers) and you can flip between them without having to save or abandon the changes. To see more, read up about set hidden.
The important thing to know here, is that each file is asking you 1 by 1 if it’s safe to discard the changes and quit or if you want to save the changes and quit. Normally you would save with
:w
or quit with:q
. Since you want to do this to ALL files and not just one, simply appenda
to the end of the command.:wa
saves all open files.:qa
quits all open files.:wqa
saves and quits all open files.