nckasg
Last Updated: June 21, 2017
·
7.885K
· iltempo
Schiller gross

Map :W to :w in vim

One of the most annoying things about vim for me was that I frequently typed :W instead of :w. This is happens because the colon needs a shift, w doesn't.

So I mapped some commands in my .vimrc:

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

Now if I am writing uppercase letters for that commands, the lower case commands will be executed.

Source: http://stackoverflow.com/questions/117150/can-i-re-map-commands-in-vim

Say Thanks
Respond

5 Responses
Add your response

2076
C2fe154ecd6b94c9510ab05b7b1c33f3

I used to do this, but then I decided to nnoremap ; :

It seems silly, but once you try it for a bit, you won't know how you lived without it!

over 1 year ago ·
12182

you changed my life forever matt, marry me.

over 1 year ago ·
13754

:x

It makes :wq even shorter.

over 1 year ago ·
16772
0 8lxtpsfpknavmqlxgfqopjjtkv bubhxcxropjyy7kbqk1c02iqsjmotyriw4k3pt66xyyhm3clq

Or just type ZZ in normal mode

over 1 year ago ·
26515
None

It worked! F-yeah!

over 1 year ago ·