Live data from Hacker News

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

news.ycombinator.com

211–220 of 279 posts

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

#211

Earlier quoted context omitted.

A sure sign of a well designed tool imo

Really? IMO that's the sign of an extremely poorly designed tool that a lot of users have learned to use very well despite how poorly it's designed. A tool that's designed well should have its actions all extremely intuitive, in which case one would not forget things in this manner because all of the actions would be derivable from their justifications. For example: ctrl+C is copy, and ctrl+V is the key right next to…

> ctrl+C is copy, and ctrl+V is the key right next to it for paste

That works in English on a QWERTY keyboard. Maybe not in other languages, and while it can be explained, it doesn't necessarily help to recall. I remember my father coming up with mnemonics to remember Ctrl-V.

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

#212
post #179

Earlier quoted context omitted.

I've been a vim user for 15 years and I still often type `:Q` and `:W`. Everyone types differently and some people make mistakes. Your blaming the victim instead of the software.

What parent @waisbrot is saying seems uncommon (the source of this whole conversation), but granted, perhaps common enough (or is it instead worrisome enough) that nvim community took it out. I still type :Q and :W as well, but that is not what is being discussed. Have you ever irrevocably bricked your system, as @waisbrot mentioned they have twice, from typing :W or :Q? Have you ever bricked your system from typing…

OP said exactly "I've twice encrypted my file with password like `cd tmp`"

Not sure how you get "irrevocably bricked your system" from "encrypted my file", but you do you, I guess

You should also let the OP do the OP. They said they made a mistake. Simply, without complaining, and they do something else now. It's that simple

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

#213

Why is it useful? I would do ZZ to quit with saving, or :q! to quit without saving. Incidentally, I find :w to be very inefficient to type (any : command really, but there are not normally the most common operations), for such a common operation. I wonder if people remap it.

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

#214

Earlier quoted context omitted.

Then upgrade to nvim like everybody else idk

Some people value stability and gvim. I don't consider nvim an upgrade, it's just a fork with different priorities which may or may not suit you. I continue to use vim and gvim.

The one gripe I gave with neovim is the stability.

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

#215

Earlier quoted context omitted.

A sure sign of a well designed tool imo

Really? IMO that's the sign of an extremely poorly designed tool that a lot of users have learned to use very well despite how poorly it's designed. A tool that's designed well should have its actions all extremely intuitive, in which case one would not forget things in this manner because all of the actions would be derivable from their justifications. For example: ctrl+C is copy, and ctrl+V is the key right next to…

No, a tool can be designed well and still require training. It’s not the tool’s job to teach the user how to use it.

> For example: ctrl+C is copy, and ctrl+V is the key right next to it for paste, making that not just muscle memory but also extremely easy to remember and even easier to explain: "press the the key to the right of C for paste".

This is a terrible example. Why is it ctrl? Why is it to the right instead of the left?

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

#216

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.

Except that vim was designed on a keyboard with the Ctrl key at the place of your current capslock (for most keyboards, Japanese still have Ctrl at the "right" plac).

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

#217

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?

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

#218

Why is it useful? I would do ZZ to quit with saving, or :q! to quit without saving. Incidentally, I find :w to be very inefficient to type (any : command really, but there are not normally the most common operations), for such a common operation. I wonder if people remap it.

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

#219

Earlier quoted context omitted.

What parent @waisbrot is saying seems uncommon (the source of this whole conversation), but granted, perhaps common enough (or is it instead worrisome enough) that nvim community took it out. I still type :Q and :W as well, but that is not what is being discussed. Have you ever irrevocably bricked your system, as @waisbrot mentioned they have twice, from typing :W or :Q? Have you ever bricked your system from typing…

OP said exactly "I've twice encrypted my file with password like `cd tmp`" Not sure how you get "irrevocably bricked your system" from "encrypted my file", but you do you, I guess You should also let the OP do the OP. They said they made a mistake. Simply, without complaining, and they do something else now. It's that simple

Parent (not OP) said more exactly

> I've twice encrypted my file with password like `cd tmp`, then saved the config file, breaking my system.

I get “irrevocably bricked system” from the fact that they “broke their system” and I am inferring it could only be something worth mentioning if it were irreversible.

I originally was trying to point out that parent was off-topic, because :x and :X are different. But a fleet of downvotes flooded in, so I defended my viewpoint for the catharsis.

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

#220
post #155

Is there a good way to manage saved-but-not-exited vim windows so I don't open the same file twice? I keep running into a problem where I'm editing a dozen files, and then I try to re-open a file I already have opened. Vim gives me a warning about this but my choices are a) tab through all my open windows until I find the right one, or b) open a new editing window and hope that I didn't have unsaved changes in the fi…

setting "nohid" will cause vim to close non-active buffers, so at least then you only need to tab through active buffers. If I run into this situation, I just close all of my open vim windows, saving as needed, but you might have a good use case for many open vim windows.

Thanks for the suggestion! I also found that MacVim has tabs, which may be better than having a bunch of open windows.
Post reply on HN