Live data from Hacker News

Can AI Exit Vim?

theadamcolton.github.io

21–25 of 25 posts

Re: Can AI Exit Vim?

#22

Obvious question demands an obvious answer. No. No-one can exit vim. I started using it nearly 30 years ago now and there is still no end in sight. I’m pretty much convinced it’s just not possible at this point.

The irony here is I have been using vim for nearly 30 years and I actually do sometimes have problems quitting. Some background needed.

Obviously I know how to exit so it's not that. I always have the following remap in my vimrc:

   > noremap :W :w
   > noremap :Q :q
What this means is if I'm going fast I don't need to get my little finger off the shift between the colon and the w/q to quit if I do it that way. Normally I quit using "ZZ" which doesn't require any shenanigans but whatever.

However, if I'm sshed into a remote machine or on a different account/in a docker container/vm or whatever and I don't have my .vimrc around most things are completely fine[1] except that I occasionally have some cognitive dissonance when I try to quit and nothing happens because I have subconsciously done ":Q" instead of "ZZ" or whatever, and my brain does a brief double-take before realising what happened.

[1] Yes you don't need a highly customized vimrc to function - most defaults are OK especially if you can load vim-sensible

Re: Can AI Exit Vim?

#23
post #13

My favorite big-brained way of quitting is ZZ (save and quit) and ZQ (quit without saving). Learned these shortcuts from a video by the legendary Luke Smith [1]. 1. https://lukesmith.xyz

Wow, this is so much easier than what i’ve been doing: :call system('kill -9 ' . getpid())

`:!sudo shutdown`

Re: Can AI Exit Vim?

#25
post #17

Earlier quoted context omitted.

Brilliant. When is the next International Obfuscated Vim Exit contest?

I misread that as "Intentional Obfuscated Vim Exit contest", which led me to wonder what the Unintentional version would bring.

Haha, my version of that is accidentally closing a split when I meant to drop a buffet, or vice versa, losing either my work or my layout.
Post reply on HN