Re:Vim Creep
by adito on Thursday July 12, 2012 @05:03PM
(#4236807)
And he end it with
This part make me smile... Wonder what others tough when see that?
[ Parent
| on HN ]
For rhetorical effect, `:wq` is right. But in the real world, `:x` is the better choice.
I disagree for the following reason: I think of :w and :q as two concepts, and :x adds a third, which I personally feel adds some cognitive load, like I now have to differentiate between wanting to write, wanting to quit, and wanting to do both at the same time. With :wq it feels to me like I'm deliberately saying "let's write and then quit".
Muscle memory is not likely to kick in anyway because I almost always use :w and :q separately. I'm modifying the file in one tmux window and compiling/running it in another, so I keep the file open in vim. I don't want to replace :q with :x because I want to be alerted if I've made some changes that haven't been written yet, because that means I may have neglected to test them.
No love for `ZZ` here? :( (And its friend `ZQ`, which is the same as `:q!`.)
Re:Vim Creep
by DigitalJack on Thursday July 12, 2012 @07:45PM
(#4237450)
I've been using vim for years and didn't know about :x. go figure.
Be aware that :wq will update the last-modified timestamp and :x will only do so if it's actually saving.
Re:Vim Creep
by artursapek on Thursday July 12, 2012 @07:54PM
(#4237473)
The only time I type :wq is when it's by accident that my finger hits both keys at once. I hate it.
Pft. What rhetorical effect? `:x` is always the better choice. :P
Re:Vim Creep
by robert_nsu on Friday July 13, 2012 @10:36AM
(#4239972)
I still use `:wq` once every blue moon. Only out of habit though.
Re:Vim Creep
by tathagatadg on Saturday July 14, 2012 @09:34AM
(#4244116)
Same here ... I'd ask people why you wanna do two keystrokes when you understand when to :x. Creatures of habit.
One thing I dislike though is accidentally having my shift key pressed which converts the :x to :X and Vim thinks I want to encrypt the file.