Wednesday, May 30th, 2007

JSVI: You love Vi. You love JavaScript. Now you have both

Category: Fun, JavaScript, Library

From the “we can do it, so we will” department we have JSVI, a JavaScript implementation of vi, in ~3.5k lines of code.


(via Dean)

Posted by Dion Almaer at 2:56 am

3.8 rating from 30 votes


Comments feed TrackBack URI

As from the javascript file:

” no particular redistribution rights are granted;

that means you do not have the right to use this on
your own web site.

this may change in the future.”

Comment by Nigel McNie — May 30, 2007

Well, this is nice… and kudos to the programmer, but unless he’s going to release it GPL or some such license, it’s totally useless.

Comment by Brad Broerman — May 30, 2007

Ha-ha-ha… no matter for me if it will be ever released under gpl or any other license, because i’ll never use it.
AJAX bring the fun back into computing :)

Comment by Anton Kudris — May 30, 2007

lol, this is totally useless, what’s the point ? Dont argue with “proof of concept”, the concept is not needed.

Oh and this is not ~3.5k lines of code, this is 77K (79 433 octets)

Useless, not AJAX related, not even “web2” related.

Comment by Laurent V. — May 30, 2007

Kudos ! This is actually what I was looking for. Now I’ll be able to use a text area as fast as I do in vi. I won’t have the impression of typing with an hand tied in the back…

Thanks a lot for this work.

Comment by David Odin — May 30, 2007

Actually, I _can_ see a usage case, two in fact:

1) If we assume someone writes something like this that is not buggy, then for all those vi hackers out there, surely it’s a better alternative than the current plain textarea? (Having said that, you could use one of those plugins to open textarea content in vi).
2) The Vimperator extension for firefox, which makes firefox behave like vim, could use something like this for an even better “vim feel”. I believe something like this is actually on the TODO list.

Comment by Nigel McNie — May 30, 2007

I like it. Consistency is a good thing. And I spend an awful lot of time on the Linux and BSD command line. Now if it can be used legally, I’ll be happy.

Comment by Steve Stuart — May 30, 2007

Useless?!? I am going to jam this in a greasemonkey script right now and make every textarea on the net a vi editable box.

The whole reason I still use Mutt is because typing emails without either vi or emacs is a pain in the rump.

Comment by Nathan — May 30, 2007

There has been this project – – for a while. Vi in a textbox. But it’s missing the killer feature: navigation with h,j,k,l.

I’ve been wanting to write my own for a while, so I could embed it in a textbox. Anyone who says this is a waste of time simply doesn’t use vim. I use the same keybindings in standalone, in my IDEs, on the command line (set -o vi), for mail, etc.; the only place I can’t use it is in the browser.

Looking forward to your GM script. Hopefully, the developer will open up the license – what on earth is a license like this doing on a subdomain named “gpl” :).

Not too sure about the way it expands to the whole page. I’d rather use vim bindings inside a normal textarea like viedit mentioned above.

Comment by Michael Mahemoff — May 30, 2007


Well I tried to use a vi trick and goto the end of the file by specifying :18282282 (ie. an arbitrary large number). My browser then proceeded to freeze and crash.

Perhaps a .length() > component check might be useful . :-|


Comment by Stuart — May 31, 2007

If I was wanting to go to the end of the file I’d use a vi trick G.

Comment by saltyDog — June 1, 2007

To answer some questions:

1. It’s primarily part of our netMail email client. This may account for a great deal of bugginess as it wasn’t originally designed to run standalone.

2. It might see a more liberal license in the future, but it certainly won’t see a more restrictive one. If you can’t wait, you can buy a hosting account which gives you redistribution rights, but not the ability to grant redistribution rights (i.e. lets you put it on your website)

3. The server hosts mostly GPL stuff. Things like cexec, mtftar, ntifconfig, isinzip, ipa, and samdump (for example) are all gpl. They’re there on purpose (as you can see from them being listed on the index).

4. is a test box: I uploaded jsvi to it (ripped out of netMail) to refer to it on a reddit comment. The server also responds to which is the URL I originally used, but nobody bothered to notice that.

5. Other vi-in-js attempts work on simulating vi modes instead of simulating ex itself, which is why “VIEDIT” and friends are worthless.

6. I don’t like the toolbar either.

Comment by Geocar — July 11, 2007

Lovely :)

The one thing i’m missing is :help!

Comment by sotto — April 21, 2008

Hi! I was the last year busy also creating a Javascript (actually written in Google Webtool Kit) vim-clone. Well its more a general purpose editor, where vim-bindings is “just” some add-on you can get activate for it.

You can find it here:

Its GPL and/or Apache License, so use it for whatever :-)

Supported Browsers: Firefox, IE (unfortunally not Opera), Safari on Windows works, but on Mac I couldn’t test it.

It took ~14k lines of sourcecode, however the GWT-compiler will turn this to ~1400 lines (is ~150kb) to download by user.

I guess everbody has its own subset of command to use, I coded everything I found important and use everyday. Unfortunally one has to decide on some subset. vim is said to have ~8500 commands, So if I coded 2 every day, I’d be busy 10 years :-)
@sotto :help i haven’t implemented also, sorry about that ;)

Comment by axel77 — April 29, 2008

Leave a comment

You must be logged in to post a comment.