Can I (re)map Ex commands in vim?

I love vim and the speed it gives me. But sometimes, my fingers are too speedy and I find myself typing :WQ instead of :wq. (On a German keyboard, you have to press Shift to get the colon :.) Vim will then complain that WQ is Not an editor command.

Is there some way to make W and Q editor commands?


Solution 1:

Try

 :command WQ wq
 :command Wq wq
 :command W w
 :command Q q

This way you can define your own commands. See :help command for more information.

Solution 2:

Alternative way to do it:

Use 'command abbreviations'

:ca WQ wq