Friday, November 27, 2009

vim: create a custom ex command to quit on ":Q"

I put this in my ~/.vimrc so that it is available in every vim session:
:command -nargs=0 Quit :qa!

Finally! I wanted this little vim tweak since quite a while. I don't want the nagging "E492: Not an editor command: Q" error message every time I type ":Q" instead of ":q".

This command simply tells vim to do a ":qa!" when the user enters ":Quit" or an abbreviation of ":Quit" such as ":Q".

No comments: