Vim.js
Written by Harry Fairhead   
Tuesday, 17 December 2013

This is not the time to get into editor wars - Vim is now available in browser. Yes, a JavaScript port of Vim exists.

vimlogo

 

There are many "ported to JavaScript" projects and stories, but the idea of this one takes a little getting used to - not because of its high performance but because it really doesn't belong in a browser. 

Vim is a command-based text editor based on the Unix vi editor. The Editor Wars that have been going on since the early days of vi are basically about whether vi or Emacs is the better one to use. The point being that if you live in a single text editor you slowly get it set up as you want it and slowly you merge your identity with it. Many programmers claim to be much faster using vi or Emacs than with the best "code completion" feature laden modern editor. 

 

vim

 

Vi, Vim and Emacs are almost badges that you are a "proper" programmer and we all know that "proper" programmers don't do JavaScript. However, Vim is written in C++ and Emscripten compiles C++ to JavaScript. So no C++, no matter how iconic, is safe. This is exactly what Lu Wang has done with Vim to produce a JavaScript port.

 

vimscreen

 

The conversion process isn't always smooth, however, and Lu Wang relates the story of the biggest problem of all - the fact that all previous Vim environments had a non-busy synchronous sleep function. That is, you can use sleep(t) without blocking the entire app. JavaScript is asynchronous and single threaded and hence functions that use sleep have to be converted to asynchronous callbacks. As Lu Wang puts it:

"Whenever vim.js crashes and you see callback function is not specified! in the browser console, congratulations, you have found one more async function at large."

The program is described as "unstable" at the moment and if you want to help with the project visit the GitHub page. 

 

vimlogo

 

The fundamental problem with Vim in a browser is - why?  

More Information

Vim.js GitHub Page

Vim Home Page

Related Articles

Turbo Pascal In JavaScript

Pit - F# to JavaScript Compiler

Software From The 80s Running In Your Browser       

JavaScript Assembly Language       

JavaScript H.264 decoder       

Doom in a web page       

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, FacebookGoogle+ or Linkedin,  or sign up for our weekly newsletter.

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

 

Banner


Wasmer 5 Adds iOS Support
12/11/2024

The Wasmer team has released Wasmer 5.0. The WebAssembly runtime adds experimental support for more back ends including V8, Wasmi and WAMR. It also now has iOS support, and upgraded compilers includin [ ... ]



Data Wrangler Gets Copilot Integration
11/11/2024

Microsoft has announced that Copilot is being integrated into Data Wrangler. The move will give data scientists the ability to use natural language to clean and transform data, and to get help with fi [ ... ]


More News

 

Last Updated ( Wednesday, 18 December 2013 )