When Vim starts, it always opens buffers of last session too. That is to say, when I leave Vim by closing all windows, but do not explicitly close buffers (by
:bd), those buffers will be opened next time Vim starts. How can I not open these buffers?
This might be caused by the 'viminfo' setting containing the "%" item. If the "%" flag is included in your viminfo setting, this means:
When included, save and restore the buffer list. If Vim is started with a file name argument, the buffer list is not restored. If Vim is started without a file name argument, the buffer list is restored from the viminfo file. Quickfix ('buftype'), unlisted ('buflisted'), unnamed and buffers on removable media (viminfo-r) are not saved. When followed by a number, the number specifies the maximum number of buffers that are stored. Without a number all buffers are stored.