I open 15 files in vim.
vim -p *.php I close one file without saving
:q Then after closing some I get this E173: 15 more files to edit.
It seems quitting a file does not remove it from a buffer.
Is there any way so that I don't get this error when I quit a file?
At the moment I have to use qall to exit.
Thanks in advance.
1 Answer
You don't quit files; in order to "close" a file, you either delete or wipe the buffer, whereas you quit the editor itself. You're using the quit-editor command (q) to close a single buffer, which is why you're getting the error message.
Here are the commands you need to know:
:bdcloses a single buffer; that is, Vim removes it from the buffer list. Some bits of information, such as marks, are still kept around.:bwcloses a single buffer andwipes it; the buffer is "really" deleted and all temporary information is lost.:qquits the editor; assumes that only one buffer is open.:qa(which is short for the:qallcommand you've been using) quits the editor and close all buffers. This is separate fromqbecause otherwise you might forget that you have other files open and accidentally lose information.