The BASIC Magic in Vim

I’ve just discovered this by accident: one can make infinite recursive loops in vim. It’s very simple: just record a macro and in that macro apply that macro.

That may seem useless but it’s not: I’m now finally able to port my very first program to vim. The original form was:

10 PRINT "HELLO"
20 GOTO 10

In vim: type <ESC> qaoHELLO <ESC> @aq followed by @a.

Leave a Reply

Your email address will not be published. Required fields are marked *

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.