News for hackers. Stuff that matters.
Re:Tell HN: Vim users, `:x` is like `:wq` but writes only wh... by sodapopcan on Saturday January 07, 2023 @10:47AM (#34289090)
Well, in fairness, `:X` brings up a prompt, so an accidental `:X` won't seamlessly masquerade itself as `:x`.

Otherwise, I feel a remap is just a valid option as any to disable it. I'm not sure there's a way (a quick skim of the docs made me think `set key=` would do it but that didn't work for me, or at least I didn't understand what it does) but either way you'd still have to add config.

But again, as I say to everyone I see using commands to quit and keeps getting brought up here: `ZZ` is the same thing.

Re:Tell HN: Vim users, `:x` is like `:wq` but writes only wh... by manaskarekar on Saturday January 07, 2023 @11:00AM (#34289270)
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.

Re:Tell HN: Vim users, `:x` is like `:wq` but writes only wh... by bravetraveler on Saturday January 07, 2023 @12:29PM (#34290338)
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

Re:Tell HN: Vim users, `:x` is like `:wq` but writes only wh... by withinboredom on Saturday January 07, 2023 @03:27PM (#34292375)
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 wh... by bravetraveler on Sunday January 08, 2023 @12:17PM (#34300950)
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 wh... by withinboredom on Sunday January 08, 2023 @02:44PM (#34302362)
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 wh... by bravetraveler on Sunday January 08, 2023 @07:33PM (#34305145)
The endless battle continues, be brave