Earlier quoted context omitted.
Indeed - hence the tendency towards caution over what I type I understand how it manifests... but I find it not that difficult to avoid My answer to lacking feedback isn't moving forward headstrong - it's verify the delicate combination went through fine
Everyone has different responses when things don’t work out exactly how we think they will. Ideally, we write software that doesn’t surprise us, however we choose to react.
Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
271–279 of 279 posts
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#272`:cq` exits vim with exit code 1. This is useful if you're in vim to write a git commit message and you realize don't actually want to commit. Or you're in vim from `fc` to edit a shell command and you realise you don't actually want to run it.
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#273Earlier quoted context omitted.
It is, but accidentally hitting capslock instead of shift when hitting the colon is extremely easy to do.
Caps Lock is that key that's best replaced with Ctrl? ;)
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#274Earlier quoted context omitted.
:wq just makes more sense to me, it’s “command: write, quit” ZZ is just.. random?
Sure, but we're talking Vim here. Is that more random than `"0p`? Or `ctl-o`? Or `ctl-6`? Mnemonics are important for operations we only perform a few times per day or every other day or less. But we're talking about a _built-in_ mapping for an operation that is performed probably as much as 1000 times per day, give or take. Convenience beats out mnemonics here because you don't need them (if you care to use it). I a…
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#275Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#276I 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.
I just tried it. :X asks you to enter an encryption key, then asks you to enter it again, and only continues if the keys match. And then you're still in vim and need to save your file to overwrite anything. Seems hard to do by mistake. (though I prefer ZZ)
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#277Earlier quoted context omitted.
I just tried it. :X asks you to enter an encryption key, then asks you to enter it again, and only continues if the keys match. And then you're still in vim and need to save your file to overwrite anything. Seems hard to do by mistake. (though I prefer ZZ)
I think i was 40 years into my usage of vi when i learned that ZQ was a thing. I bet someone else learns it right here.
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#278Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#279`:cq` exits vim with exit code 1. This is useful if you're in vim to write a git commit message and you realize don't actually want to commit. Or you're in vim from `fc` to edit a shell command and you realise you don't actually want to run it.