Live data from Hacker News

Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made

news.ycombinator.com

261–270 of 279 posts

Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made

#261
post #238
post #77

Earlier quoted context omitted.

A good software interface must be discoverable by the user. I imply here that hardly anyone knows about ZZ because of improper design, which explains why it's not generally mentioned in tutorials. Compare vim or its clones with any KDE application, which always has keybindings shown in menus, and always a complete list of rebindable keybindings in the settings menu.

Your implication looks strange considering that ZZ is literally the first command mentioned in “The first steps in Vim / Getting out” section. Most likely it isn’t mentioned in tutorials because these are 99% copypaste medium bullshit from wannabe teachers. https://vimdoc.sourceforge.net/htmldoc/usr_02.html#02.7 To exit, use the "ZZ" command. This command writes the file and exits. I remember reading about it 17 year…

You need to make an effort to understand that RTFM is not the answer to the reproval of improper design, and shifting the goalpost from "discoverable user interface" to "looking for documentation and learning materials" does not do any favours to your argument.

A possible correct solution is already given as an example in my previous post.

Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made

#263

Earlier quoted context omitted.

Caps Lock is that key that's best replaced with Ctrl? ;)

Only for Emacs users. Vim users generally replace it with Escape.

I'm a vim user and replace it with Ctrl. It's much more useful and you can use ^[ to get Escape.

Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made

#264

Earlier quoted context omitted.

On my build, I have to confirm the key -- is this not the case with yours? I suppose one could naively type the same thing twice, but I feel like some caution also goes a long way. Driving without looking at the road is generally dangerous Any time I accidentally shift-mod my saves, I immediately see the encryption prompt, and back out with SIGINT. I don't really buy the problem, so to speak

On a laggy/slow ssh connection, if you don't notice the encryption prompt, it is quite easy to just try the exact same thing again.

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

Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made

#265
post #251
post #82

Earlier quoted context omitted.

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.

Irreversible? There's undo and version control.

Yes, and file system snapshots and remote sync. But writing to a file, in the general case, is an irreversible action.

Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made

#266

Earlier quoted context omitted.

On a laggy/slow ssh connection, if you don't notice the encryption prompt, it is quite easy to just try the exact same thing again.

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.

Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made

#267
post #261
post #238

Earlier quoted context omitted.

Your implication looks strange considering that ZZ is literally the first command mentioned in “The first steps in Vim / Getting out” section. Most likely it isn’t mentioned in tutorials because these are 99% copypaste medium bullshit from wannabe teachers. https://vimdoc.sourceforge.net/htmldoc/usr_02.html#02.7 To exit, use the "ZZ" command. This command writes the file and exits. I remember reading about it 17 year…

You need to make an effort to understand that RTFM is not the answer to the reproval of improper design, and shifting the goalpost from "discoverable user interface" to "looking for documentation and learning materials" does not do any favours to your argument. A possible correct solution is already given as an example in my previous post.

I wasn’t shifting goalposts, only noted that the state of tutorials doesn’t explain much in the light of the described phenomenon. Apologies for this venture.

Granted, it would be nice to see more apps using the solution you described. But personally I don’t find a list of commands in a table that much different from a list of commands in a text wrt discoverability.

Another nuance discussed here https://news.ycombinator.com/item?id=34287407#34293277

Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made

#268
post #68

I always :q when I didn’t change anything. If I changed something intentionally, :wq and :x are equivalent. If I changed something accidentally, :x won’t catch that, and :q complaining will require me to decide if :q! or :wq is correct. So :x does not fit my workflow of avoiding accidental writes. Just like ZZ does not.

ZQ will quit without writing anything.

Re: Tell HN: Vim users, `:x` is like `:wq` but writes only when changes are made

#270

Front page and more than a hundred comments for a basic Vim command. Reddit is leaking.

What do you mean by "Reddit is leaking"? Do we hold ourselves to a higher standards out of merit of posting here? Is there some sort of tribalistic exclusivity that was broken? Was there perhaps a manual of commands a Vim user who posts here must know before creating an account?

The chances of the crowd here using emacs or vim are very high. Yes that makes it an 'elite board' if you consider basic editor commands as the standard.
Post reply on HN