Last Updated: February 25, 2016
·
675
· jonotron

Remap :W to :w for lazy shift finger saving

Not an editor command: W got you down?

Put this in your $MYVIMRC:

cnoreabbrev <expr> W ((getcmdtype() is# ':' && getcmdline() is# 'W')?('w'):('W'))

Source: http://stackoverflow.com/questions/3878692/aliasing-a-command-in-vim

Note: Not sure if this will break other commands or not, but has been safe for me.

2 Responses
Add your response

And again, I think using map <C-S> :w<CR> is a much better alternative.

over 1 year ago ·

That's a lot of voodoo, you can get away with something like this:

command W w
over 1 year ago ·