Live data from Hacker News

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

news.ycombinator.com

191–200 of 279 posts

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

#191

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

I may not be an uber geek but I’ve been using vim for 10 years, even written a plug-in and I didn’t know this.

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

#192

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

You get that kind of response anytime the subject matter is vi or vim. Still more if it mentions nvim, nano or, god forbid, emacs(!)

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

#193
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.

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

#194

Earlier 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? ;)

I like Compose on CapsLock more.

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

#195
post #180
post #177

I almost exclusively exit vi using CTRL_W-CTRL-Q. It's a 3 finger chord that I use all the time to close vi windows. Makes sense that I'd use it to close the last one too.

You might as well use emacs at that point.

Been using vi for just over 25 years now. The only thing I know how to do in emacs is exit :D vi uses the ctrl key a ton if you know what you are doing.

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

#196

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 ; :

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

#197

Earlier quoted context omitted.

Yeah, but it's possible to quickly type the next command (that you would after exiting vim) as the encryption key. That said, given that neovim doesn't have this feature at all makes it less of an issue to me.

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.

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

#198

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 remap `` to save because I like to obsessively spam it after every couple edits.

Fun fact, ZQ quits without saving, like :q!

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

#200

Earlier quoted context omitted.

[dead]

The only reason the footgun is there is because vim put it there. Seems reasonable to me to be frustrated by that.

Then upgrade to nvim like everybody else idk
Post reply on HN