Earlier quoted context omitted.
I always use ZZ! It’s so much more convenient to type with one hand
I really like having to use both my hands to perform an irreversible change to disk. Those extra milliseconds let me think through what I’m doing.
Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
251–260 of 279 posts
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#252Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#253Earlier quoted context omitted.
So how is it different?
^C interrupts the current operation, while ^[ actually finishes the input sequence. The only practical difference I can think of is that when you entered input mode with a prefixed number, ^C ignores it. So 2iabc^C only writes `abc', but 2iabc^[ writes `abcabc'. Edit: apparently ^C also ignores abbreviations. :ab lhs rhs, then ilhs^[ writes rhs, but ilhs^C writes lhs.
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#254Front page and more than a hundred comments for a basic Vim command. Reddit is leaking.
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#255Earlier quoted context omitted.
I use the following in my vimrc so I can just use semicolon instead. nore ; :
I like that AZERTY has colon on the lower row :) You can remap your keyboard as well.
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#256Earlier quoted context omitted.
I use the following in my vimrc so I can just use semicolon instead. nore ; :
Sounds like a good idea. Any drawback that I don't see? Why not ; in the first place? perhaps to avoid hitting it accidentally.
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#257Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#258I learned to do `:wq` after I learned that `:X` encrypts your file. When typing without really paying attention to the screen, I've twice encrypted my file with password like `cd tmp`, then saved the config file, breaking my system. After that, I switched to `:wq` (and sometimes `:w` `:q`) which is much safer against over-typing.
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#259Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#260Earlier quoted context omitted.
ZZ is only 3 keystrokes as opposed to 4 for :x (shift + z + z = 3 and shift + ; + x + enter = 4). It also doesn't require timing the release of shift before the press of x.
Wow! Never knew that existed. If I can undo 20 years of muscle memory, I'll use it. :D EDIT: Just tried it, and Z being right next to Shift is a deal breaker.