alt.hn

3/29/2026 at 1:52:41 AM

Can AI Exit Vim?

https://theadamcolton.github.io/can-ai-exit-vim

by topwalktown

3/29/2026 at 3:33:23 PM

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

by bean469

3/29/2026 at 5:30:15 PM

Wow, this is so much easier than what i’ve been doing:

:call system('kill -9 ' . getpid())

by stonegray

3/29/2026 at 6:01:27 PM

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

by mwcz

3/29/2026 at 8:03:39 PM

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

by ErroneousBosh

3/30/2026 at 12:28:01 PM

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.

by mwcz

3/30/2026 at 6:21:53 AM

`:!sudo shutdown`

by ramon156

3/29/2026 at 1:52:41 AM

I test if qwen3.5-35B-A3B can exit vim when running in a harness that allows it to read the raw terminal buffer and send raw key presses to the terminal. Enjoy!

by topwalktown

3/29/2026 at 8:05:04 AM

what harness do you use ?

by slim

3/29/2026 at 4:11:02 PM

I wrote it myself it python. The model runs in a loop and can either read the terminal or input keys. If it does neither the loop exits.

by topwalktown

3/29/2026 at 9:35:17 AM

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.

by seanhunter

3/30/2026 at 5:30:13 AM

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

by seanhunter

3/29/2026 at 11:47:48 AM

Did you try turning your computer off and on?

by griffzhowl

3/29/2026 at 2:32:52 PM

It boots into Vim.

by layer8

3/29/2026 at 1:24:02 PM

:!poweroff

by glouwbug

3/29/2026 at 2:18:42 AM

https://theadamcolton.github.io/can-ai-exit-vim/

is 404

by k310

3/29/2026 at 2:39:18 PM

remove the trailing slash

by robobro

3/29/2026 at 3:37:12 AM

Sorry! It should work now.

by topwalktown

3/29/2026 at 4:35:26 AM

Thanks

:wq!

by k310

3/30/2026 at 4:27:25 AM

he exited!!!

by iainctduncan

3/30/2026 at 12:08:07 AM

The AI model is likely trained on Stack Overflow posts, or otherwise related content from wherever off the internet, so most likely it will have ripped off enough hand-written posts or articles on how to quit Vim. So of course it can regurgitate the required keystrokes on command.

And will the writers of those posts, who contributed their knowledge to help out their fellow humans, get a fraction of a penny for the hundreds and thousands and millions of dollars of profit the AI corps are making off the backs of their labour? I somehow doubt it.

by NackerHughes

3/30/2026 at 10:53:46 AM

Yeah, but it would still open three tabs, rewrite my config, and ask whether I meant :q or :qa!

by meszmate

3/29/2026 at 5:37:13 PM

Vimscript is extremely token efficient and very common in training data.

Dunno about constraining to a window, but vimscript itself could be a good way of sending editing commands.

by stonegray