1

I would like Vim to quit without saving when I enter :q.

It annoys me when Vim prompts me to save when I try to quit a document with :q having made changes to it. Whenever I want to keep changes I save them. Plus the ! of :q! is awkwardly positioned on my UK keyboard. How can I remap :q to act like :q!?

And Finally
  • 5,370
  • 14
  • 64
  • 106

1 Answers1

5

You can use cabbrev, that works like a map from a command line instruction to another one, like:

:cabbrev q q!

So now just type:

:q

and it will omit changes to exit without asking.

Birei
  • 34,778
  • 2
  • 71
  • 80