5 ms·
And he end it with :wq This part make me smile... Wonder what others tough when see that?
by adito 14y ago
And he end it with
:wq
This part make me smile... Wonder what others tough when see that?
- tsm 14y agoFor rhetorical effect, `:wq` is right. But in the real world, `:x` is the better choice.
- DigitalJack 14y agoI've been using vim for years and didn't know about :x. go figure.
- artursapek 14y agoThe only time I type :wq is when it's by accident that my finger hits both keys at once. I hate it.
- tsm 14y agoBe aware that :wq will update the last-modified timestamp and :x will only do so if it's actually saving.
- saraid216 14y agoPft. What rhetorical effect? `:x` is always the better choice. :P
- sofal 14y agoI 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.
- anders0 14y agoNo love for `ZZ` here? :( (And its friend `ZQ`, which is the same as `:q!`.)
- robert_nsu 14y agoI still use `:wq` once every blue moon. Only out of habit though.
- tathagatadg 14y agoSame 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.