5g0jag
Last Updated: February 25, 2016
·
1.392K
· jkirchartz
F700694ebf2911ddfcb0d25c5e0a97b1

Prevent VIM write misfires

If you find yourself accidentally hitting :Wq or :W when you try to save, you'll have to try again, lets avoid these misfires by adding the following to your .vimrc file:

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

These will map common misfires to the desired command.

Say Thanks
Respond

5 Responses
Add your response

1417

I prefer to use ZZ (2 keystrokes) instead of :wq enter (4 keystrokes)

over 1 year ago ·
1629
3d6cf87db87992c185ac03432dbaf986

:x

over 1 year ago ·
1632
076ddab874e5e370a451f0da52afb85c

Another one? Seventh post about it?

over 1 year ago ·
1922
B5c7599bfa993fc0164d4a3b60ede8a4

Maps like these are bad form; remember that not every server or machine you're on is going to have these maps and you're using them as a crutch. Don't fall over, now :)

over 1 year ago ·
1975
F700694ebf2911ddfcb0d25c5e0a97b1

indeed this is a "crutch", in-so-much as BASH aliases are too. It only avoids a minor annoyance on the device you set it on. If you're on a server where you haven't set it up no harm done you just have to try again & hope your fingers aren't so chubby this time.....

over 1 year ago ·
Filed Under

Awesome Job

Bc0a6794 05ee 11e8 902a 778405599bdb
Software Engineer
·
Denver, San Francisco
·
Full Time