Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thanks for bringing this up.

I'm toying with either disabling it,

    cmap X <Nop>
or, mapping it down to a lower x.

    cmap X x
1. Does anyone see anything this could interfere with?

2. Does anyone know a better way to turn off the `:X` encryption option?

Sadly, having to remap definitely dulls the shine of `:x`.



Mapping to 'x' is dangerous since on a system where you don't have your vimrc you'll get the original behavior of 'X'. Ideally you'd map 'X' to deliver a small electric shock. ;-)


  cmap X x
  :help X
> Mapping to 'x' is dangerous since on a system where you don't have your vimrc you'll get the original behavior of 'X'.

Which is still to prompt? A person could take their chances.

Besides, wouldn't that form of intentionally aversive conditioning actually boost the learning rate and create hyperassociations to the behavior your're attempting to stimulus extinct or just learn over?


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.


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.


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.


The endless battle continues, be brave




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: