Drop #179 (2023-01-17): Excitando Emergentes Editors

wasavi / vim.wasm; Pulsar; ecode

Perhaps, the best phrase to describe the impetus for the continued evolution of the humble text editor since the early days of computing is “adopt, adapt, and improve”. Sure, real coders/workers still use ed for all their needs, but the rest of us are eager and willing to use modern, bionic constructs that significantly enhance our productivity.

Today, we cover something old (with a modern twist), something borrowed, and something new; then, round it up with something blue just to meet the expectations of tradition.

wasavi/vim.wasm

Real Programmers

The “emacs vs. vi[m]” flame wars always puzzled me, since — down deep — I’m in the “use whatever makes you most productive” camp (whilst also reserving the right to partake in some mischievous banter now and again). Having said that, I’m squarely in the “vi[m]” camp when at the command line. Now, I can also choose to be in the browser with two (of a few) neat projects that bring vi[m] to WebKit, Quantum, and Chromium via the previous year’s new hotness that is WASM (darn that ChatGPT for stealing the spotlight this year).

Vim.wasm [GH] has been around for a few years, and it (mostly) “just works”. It’s packed with features:

  • Virtually all of Vim’s feature set (syntax highlighting, Vim script, text objects, …) are supported

  • You can drag & drop files to a browser tab which will open them in Vim.

  • It’s possible to paste system clipboard text to the editor via "*p or :put *, and copy text in it to the system clipboard with
    "*y or :yank *. You can also synchronize the editor’s clipboard with system clipboard using :set clipboard=unnamed.

  • Files under ~/.vim directory is persistently stored in [Indexed DB][idb] and can be downloaded using :export.

  • Color schemes are 100% supported.

  • :!/path/to/file.js evaluates the JavaScript code in browser. :!% evaluates current buffer.

  • vimtutor is available by :e tutor.

  • Adding the query parameter file={filepath}={url} fetches a file from {url} to {filepath}. Arbitrary remote files can be opened (with CORS restrictions).

  • Use arg= query parameters (e.g. ?arg=~%2f.vim%2fvimrc&arg=hello.txt) to add vim command line arguments.

wasavi is another, even older project that is an extension for Chrome, Firefox, and Opera that changes <textarea> elements to virtual vi editors. It’s a bit crufty, but deserves some attention, especially if you want to get a peek at how to use WASM in similar fashion (having a WASM component preloaded as an extension can save bandwidth and speed up instantiation).

Pulsar

blue and purple galaxy digital wallpaper

I end up using 3–4 editors daily. Sublime Text for general purpose editing (GPU rendering and native OS integration FTW), vim at the command line (so, perhaps the most used editor), VS Code for most coding tasks, and RStudio. Those last two are “just” a bunch of components shoved in a browser context ala Electron.

Since I come from the days when we both wanted to and had to optimize programs (e.g. overlays) for size/speed Electron — and similar ilk — are anathema; much in the same way running Dockerized versions of command line apps are. But, ridiculous processor speeds and the embarrassment of riches that are modern RAM and SSD sizes made it possible for folks to crank out bloated — but useful — new creations.

If you remember Atom — an Electron-ified editor built by GitHub (pre-Microsoft acquisition) — you may be interested in Pulsar, a community-maintained fork that is in active development.

I drop Pulsar today, as I discovered some Atom users still don’t know about it and want to continue using something that works for them. I’d strongly suggest Atom/Pulsar users poke around a bit and at least get familiar with other options. It’s hard to see how Pulsar — which has the scientific definition of a “degenerate neutron star”, will be anything but a niche object in an ever-growing and crowded universe of text editors.

Drop a note in the comments with any counters to said argument 😃.

ecode

⚠️ Let me preface this section with a teensy caveat: The GitHub link to the ecode repo works, but it presents a README + LICENSE and downloadable release binaries for a few platforms). No source code is available, save for the other link to a sibling project that provides the GUI framework for it. We all trust closed-source app binaries every day, but I’m not so sure that we should.

Caveat Emptor.

ecode is a new-ish (public git tags go back to mid-2022) GUI editor on the block based on eepp, an open source cross-platform game and application development framework (C++-based).

Self-billed as a “lightweight multi-platform code editor designed for modern hardware with a focus on responsiveness and performance”, it certainly feels snappy (yes, I dared d/l and run it).

There appears to be no attempt at having ecode even pretend it’s part of your OS’ native app ecosystem, so the UX/UI might be a bit strange at first. But, it comes with batteries included, renders to WebGL, and has a WASM version (that relies heavily on SharedArrayBuffers — which may require you to rejigger your browser config).

Experiment cautiously if you choose to poke at this nouveau offering (so far it hasn’t been skeezy network-wise, but we’ll give it some time under the lab network’s monitor).

FIN

We’ll leave you with one of Chris Holmes’ pixel-art experiments for the “blue” part:

Leave a comment

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