The Whole Computer Is Vim

Love it or hate it, Vim, the vi-compatible minimalist editor, is a common denominator between a huge array of operating systems. If you need to edit a file, it’s usually safe to expect it there if your normal editor is absent. Now thanks to [Omwah] it’s moved onto the most meager of platforms, where it becomes the firmware itself rather than a program running on an OS.

ESP-Vim is, as its name suggests, Vim, for some of the ESP32 series of microcontrollers. It boots straight into the familiar editor on an attached screen, and it has filesystem and git access, along with MicroPython. It’s a small computer for working with text files and some basic scripting, and we like the idea.

It needs a board with an ESP32-S3 or P4, with 16 MB of Flash and at least 8 MB of PSRAM. There’s a list of boards that meet this spec, and we can’t help noticing that one of them is the version of the Cheap Yellow Display that comes with an S3. Hook up a Bluetooth keyboard and you’re in.

How easy it will be to use remains to be seen, but bearing in mind that the vi interface followed by Vim was designed for very slow terminals in a much earlier decade, and it could be just right for these platforms. Would you use one?


Vim logo: The Vim project, VIM License.

42 thoughts on “The Whole Computer Is Vim”

    1. Yeah, vim is by no means minimalist. If someone wants to experience a minimal, plain-vanilla vi, try busybox’s vi applet.

    1. In much the same way that a camera – a device that does nothing but record still images or video, is limited to the point of unusable.

  1. For the purpose of editing file directly on Micropython I happily use the Micropython Editor which has the ergonomics closer to nano editor
    https://github.com/robert-hh/Micropython-Editor

    I usually add also mpy-shell, which is stuffed of unix-like utilities right in the micropython REPL
    https://github.com/gitcnd/mpy_shell

    With just >>> import sh one feels like running an UNIX on micropython
    Both are lightweight and careful of resources usage, and only marginally impact the Flash real-estate, especially as frozen modules.

  2. I’m imagining someone doing the equivalent for 1980s-or-earlier-era hardware, or the modern equivalent. Something with 64KB of RAM, perhaps. Maybe implemented as an electronic typewriter with a few lines of display.

    1. Back in the day, we called that Wordstar. Or, if you wanted a plain text editor, Turbo Pascal and you got a compiler also, all in 16k of RAM.

    2. Maybe I don’t understand your idea of “modern equivalent”, but I think that an ESP32-S3 IS the modern equivalent of 1980s-or-earlier-era hardware.

      1. Almost. The 80s wasn’t about brute force (raw CPU power).
        That’s what so different with modern µCs, I think.
        They’re very fast but dumb and modern software has no grace.

      2. “modern equivalent” would be a CPU that was similar in power to the chips of the 1980s or earlier that is still in production. I should’ve spelled it out, as a true “equivalent” would be a clone or at least close-enough-clone of one of those vintage chips.

      1. 👏👏👏

        one of my biggest complaints about AI-driven development is that, sure, the code may work, but it seems to encourage bloat as we become less discriminating. I think prompts could help out — “always use well-tested, lean third-party libraries instead of rolling your own when there’s an option” — and tooling like a reviewer AI that tries to clean the code up. Sorta feels like trying to patch the problems that never would’ve existed before the solution came along though.

        </👴>

  3. I see many new “writer decks” being created.

    I also feel comfortable in saying that Emacs is not a good candidate for a similar project.

  4. sounds like he11! the only time i need to know anything about VIM is when i find myself suddenly in it and am googling how to get out, since even how to do that IS NOT OBVIOUS

    1. Kind of like Python, that way.

      I used to use vi exclusively, but then I got tired of forgetting that I had popped out of entry mode and subsequently doing unimaginable damage to my document. Now I find that even the most simplistic text editor whose name does not include “vi” or “emacs” is tons better than any WITH either of those names.

    2. Hit the “escape” key just in case you’ve already started some function.
      Type a colon :
      Type q
      Hit the “enter” key.
      Back at the command line.

      Joke: See. It wasn’t that complicated, was it?

      (I had to fire up a Linux system to double check it. I don’t use vi that often, either.)

      1. Press Esc
        type a colon ( : )
        type q!
        ( the ! is important if you just want to get out, without saving ) .

        Ah, muscle memory …..

  5. IMHO, sure looks like a reincarnation of a late 1980s typewriter.

    I still remember when they were sold everywhere, and they were not in any way or form related to the computers, mostly their own proprietary niche carefully guarded from the attempts to pry it open for the masses. Kind of M$ Windows walled garden, and, sure enough, they largely quietly expired once average printer could rival any typewriter in speed and resolution.

  6. The title “The Whole Computer Is Vim” is misleading. Maybe it should be “An ESP32 Crippled to Only Run Vim”?

  7. Emacs (“editor macros”) was originally built on top of control-R mode in TECO. I seem to remember that VI had similar origins. And TECO itself was designed back in the days of 300-baud teletypes; realtime mode was added when CRTs acquired cursor control.

    TECO approaches being APL for text editing, in terms of terseness. A command string would typically intermix operations with data to be inserted, and could include programmed loops. Macros (stored and named command sequences) gave it convenience functions and subroutines. The escape character (typically echoed on paper as $) was used as a terminator for strings; double-escape was “end of command string, execute now.”

    Though there was a search and replace operator, doing that explicitly with progress display makes a good example:

    j<sfoo$;-3dibar$0tt>$$

    j Jump to start of buffer.
    <> Iterate /loop
    s Search. Search string follows, ended by escape.
    ; If preceding operation failed, break out of loop.
    -3d Delete 3 characters preceding the edit point/cursor.
    i Insert following escape-terminated string.
    0t Type the current line from start to cursor
    t Type the current line from cursor through line break

    Control-R mode invoked an interpreter loop which read input characters and used a mapping table to dispatch a macro for each one. Hence core Emacs being mostly non-modal (or transiently modal); input text was dispatched to the insert-me macro while command characters (control characters) were dispatched to appropriate operations.

    Teco became a rather extrnsive language before RMS rewrote Emacs in Lisp. I volunteered at one point to rewrite the Teco documentation from flat file to Emacs help files just because it seemed worth doing.

    (This was back in the innocent, edenic days when research machines responded to unknown user IDs with “Oh, would you like me to create an account with that name?”, and simply having the equipment and sophistication to get onto the ARPAnet was evidence of trustworthiness.)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.