If I have this line in my vimrc
au VimLeave %bdelete
Then whenever vim starts it says
--- Auto-Commands ---
Press ENTER or type command to continue
I have that line there to empty the buffers from gvim, because new gvim instances have massive :ls
output from previous runs. Notably, gvim doesn't actually produce this prompt.
Obviously I can set this instance up to only occur during gvim startup and not console vim, but I'd like to understand this rather than avoid it. Mostly I'm confused that VimLeave
seems to cause things to happen on startup.
TIA Altreus
The problem is that this is an incomplete :autocmd
definition, so Vim attempts to list all VimLeave
autocommands defined for the pattern %bdelete
. You need to specify the any file pattern to make it work:
au VimLeave * %bdelete
Also, check whether you have %
in your 'viminfo'
option; that one enables the saving and restoring of the buffer list you're complaining about. The f
option of file marks may also result in buffers being restored; you could try :set viminfo+=f0
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With