I also have a funny related thing to Tell HN: `git --amend` -> `:wq` is shorter and faster to type than `git --amend --no-edit`
Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
141–150 of 279 posts
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#142Earlier 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)
If only! I was a TA for an introductory CS class that taught C++ and, in passing, vi. A hour before one assignment was due, a student showed up in a panic. “I just had it working but then the computer corrupted my file. Look! Can I have an extension?” The other TA and I smirked: What a lame excuse! We offered some generic advice about starting earlier and visiting office hours. He left in a huff. A few minutes later,…
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#143I 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.
In neovim, :X (and cryptography in general) is removed https://github.com/neovim/neovim/commit/85338fe
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#144Earlier quoted context omitted.
If only! I was a TA for an introductory CS class that taught C++ and, in passing, vi. A hour before one assignment was due, a student showed up in a panic. “I just had it working but then the computer corrupted my file. Look! Can I have an extension?” The other TA and I smirked: What a lame excuse! We offered some generic advice about starting earlier and visiting office hours. He left in a huff. A few minutes later,…
[flagged]
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#145Earlier quoted context omitted.
Make sure to see this comment about :X encrypting your file instead of exiting https://news.ycombinator.com/item?id=34288446
I can't help but see that argument as post rationalization from people who have bee using :wq their whole life \s Been using :x from the start about 4 years ago and I never accidentally encrypted a file.
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#146Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#147I also have a funny related thing to Tell HN: `git --amend` -> `:wq` is shorter and faster to type than `git --amend --no-edit`
I often have the variant with --amend --no-edit in my bash history, so that I press up about two or three times instead of writing anyting at all.
Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#148Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made
#149See, that's why even though I'm a terminal user first and foremost, I really like the discoverability of GUIs, and that's where a good GUI is unbeatable by CLI. This would have just been an entry "Save if needed" in the File menu, right below "Save", and users would probably find it by accident while looking at the menu, even while not actively looking for new ways to save a file. (Not getting into the fact that a we…
I agree that Vim's a mess, but I don't think a good GUI is unconditionally better because you'd need to cut down Vim's gigantic command set in order to make the GUI comprehensible. Just in this thread we've seen options for: close unless there are changes, discard changes and close, save and close, save if changed and close, and save with encryption and close. These would not be menu items. In a GUI, you would have c…