@@ -59,25 +59,25 @@ March 27th 2026
5959 reads a file using Opencode the result is truncated by default to 2000 lines.
6060 This is great for allowing the agent to receive the maximal amount of
6161 information about the file contents. But sometimes I wonder if the 2,000 lines
62- are overkill. After all, human programers have hacked on code with tiny 40x100
63- sized terminals for decades without issue.
62+ are overkill. After all, human programers have hacked on code with tiny
63+ terminals for decades without issue.
6464</p >
6565
6666<p >
67- As a sort of a half serious toy project I want to see if AI models can use Vim
67+ As a sort of half serious toy project I want to see if AI models can use Vim
6868 to edit large files. Vim is possibly more context efficient than tools like
6969 opencode. Instead of dumping huge files into the context, vim constrains the
70- agent to only ever see a fixed 32x64 sized terminal window. The agent's
70+ agent to only ever see a fixed-sized 32x64 terminal window. The agent's
7171 context is thus transformed from a sloppy pile of file contents to a crisp
7272 stream of terminal window snapshots.
7373</p >
7474
7575<p >
7676 My end goal is to test if the AI can use CLI text editing tools to do some
7777 complex edits. But first there is a rite of passage I feel obliged to perform.
78- Many a young hacker has no doubt smashed their fists against their keyboard in
79- anguish over that one particularly obstinant CLI command that just refuses to
80- close. But can AI exit Vim?
78+ Many a young hacker has no doubt smashed their fists against their keyboard
79+ anguishing over that one particularly obstinant CLI command that just refuses
80+ to close. But can AI exit Vim?
8181</p >
8282
8383<MediaBox >
@@ -88,8 +88,9 @@ March 27th 2026
8888<h2 >The Harness</h2 >
8989
9090<p >
91- First I want to describe the agentic harness I am using to allow the LLMs to
92- interact with Vim and other commands as if they were typing into a keyboard.
91+ First I want to describe the custom agentic harness I am using to allow the
92+ LLMs to interact with Vim and other commands as if they were typing into a
93+ keyboard.
9394</p >
9495
9596<p >
@@ -102,6 +103,16 @@ March 27th 2026
102103 >.
103104</p >
104105
106+ <p >
107+ It's very simple. When the model calls <code >read_term()</code > I render the
108+ text of the 32x64 terminal as a string after adding a special ansi code to the
109+ character where the cursor is. Anything the model inputs with
110+ <code >input()</code > I write directly to the terminal process after un-escaping
111+ the special characters. The model is running in a high strung busy loop like some
112+ overcaffeinated gambler. Unlike Opencode it doesn't wait for the output of commands
113+ to finish. It simply consumes and generates tokens as fast as it can.
114+ </p >
115+
105116<table >
106117 <tr >
107118 <th > Tool </th >
@@ -191,16 +202,6 @@ March 27th 2026
191202 </small >
192203</AsideBox >
193204
194- <p >
195- It's very simple. When the model calls <code >read_term()</code > I render the
196- text of the 32x64 terminal as a string after adding a special ansi code to the
197- character where the cursor is. Anything the model inputs with
198- <code >input()</code > I write directly to the terminal process after un-escaping
199- the special characters. The model is running in a high strung busy loop like some
200- overcaffeinated gambler. Unlike Opencode it doesn't wait for the output of commands
201- to finish. It simply consumes and generates tokens as fast as it can.
202- </p >
203-
204205<h2 >Can it exit Vim??????</h2 >
205206
206207<div bind:this ={aiExitingVimContainer } class =" asciinema-responsive" ></div >
@@ -211,7 +212,7 @@ March 27th 2026
211212 Actually it is so fast at using and writing with Vim that I had to slow down
212213 the above video by TEN TIMES just to get it to a speed where it was actually
213214 interpretable. Very humbling. It blows my mind that this is running on a six
214- year old GPU which is still the best value GPU that NVIDIA has every released .
215+ year old GPU.
215216</p >
216217
217218<p >
0 commit comments