Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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!`.)


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.


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


I still use `:wq` once every blue moon. Only out of habit though.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: