bit-tech.net

vi editor in JavaScript

vi editor in JavaScript

Although advanced features like colour-coding aren't yet available, jvsi is still pretty darn handy for vi users.

If you're a Linux fan wondering how to keep those damn Emacs users from commenting on your blog, you might want to check out a natty little JavaScript applet called jvsi.

Created by Internet Connection (link requires JavaScript) and recently popularised by hacker site Hack a Day, jvsi is a clone of the excellent text-editor vi written in JavaScript.

What jvsi does is turn any text box into a vi window, with rich editing tools at your fingertips. With the power of vi under its hood, jvsi features all the excellent features that you never knew you needed while browsing the web – ed/ex command support, vi-keys, full Unicode support, and more.

If you've never used vi, or its more recent incarnation as Vim (Vi IMproved) which comes bundled with most Unix-alike operating systems – the system of modal editing might take a bit of getting used to. Basically, vi has two modes – insert mode and command mode. When in insert mode, the system operates like a traditional text editor: whatever you type appears on-screen. In command mode, by contrast, the keyboard turns into a powerful editing toolkit: if you want to delete an entire line, as an example, you can do so just by typing “dd”.

The long-running editor wars are far from over, with Emacs fans defending their choice of editor – often described as a promising operating system lacking only a good text editor – to the bitter end. If you're a vi fan, then implementing jvsi on the comments section of your blog is a good way of ensuring only the enlightened are able to post. In keeping with it roots, jvsi is distributed under the GNU General Public Licence.

Are you a vi believer, or an Emacs heretic? Perhaps you think that they're both too complicated for their own good? Share your thoughts over in the forums.

16 Comments

Discuss in the forums Reply
bowman 9th July 2008, 11:55 Quote
Ha. I use nano, I'm a noob. Although I do use vi when _forced_ to do so. :p
TomH 9th July 2008, 12:13 Quote
Oh great, now I can get trapped in my browser as well as my terminal.. :p

Obligatory bash quote:
Quote:
<Aoi-chan> everyone's first vi session. ^C^C^X^X^X^XquitqQ!qdammit[esc]qwertyuiopasdfghjkl;:xwhat

:D
RTT 9th July 2008, 12:16 Quote
Vi/m is the best editor ever and anyone who doesn't know how to use it is missing out. x1000
Timmy_the_tortoise 9th July 2008, 12:31 Quote
I...... Don't get it....
M4RTIN 9th July 2008, 14:16 Quote
Quote:
Originally Posted by Timmy_the_tortoise
I...... Don't get it....

i concur doctor.. :?
SlickGnome 9th July 2008, 14:44 Quote
That is freakin sweet. I have alittle web app i'm working on for work, and that is sooo gettting dropped in just to confuse the sock off people.
Redbeaver 9th July 2008, 15:49 Quote
Quote:
Originally Posted by TomH
Oh great, now I can get trapped in my browser as well as my terminal.. :p

Obligatory bash quote:
Quote:
<Aoi-chan> everyone's first vi session. ^C^C^X^X^X^XquitqQ!qdammit[esc]qwertyuiopasdfghjkl;:xwhat

:D

lol i get this...
Timmy_the_tortoise 9th July 2008, 16:30 Quote
I don't appreciate how this article assumes that I know what "vi" and "Emacs" are..
JrRRr 9th July 2008, 17:12 Quote
Quote:
Originally Posted by Timmy_the_tortoise
I don't appreciate how this article assumes that I know what "vi" and "Emacs" are..
Really? No? Ok.. ..I agree this article was a bit on the nerdy side. But I I can relate to TomH's bash quote...
cyrilthefish 9th July 2008, 17:21 Quote
Quote:
Originally Posted by TomH
Oh great, now I can get trapped in my browser as well as my terminal.. :p

Obligatory bash quote:
Quote:
<Aoi-chan> everyone's first vi session. ^C^C^X^X^X^XquitqQ!qdammit[esc]qwertyuiopasdfghjkl;:xwhat

:D
I never got past that stage :D

First thing i do on any linux system is make sure nano is installed ;)
pendragon 9th July 2008, 18:40 Quote
heh, that's exactly how it looked when I used vi ... don't think I ever bothered to figure it out after that... I like nano sofar.. very simple and easy to pick up .. then again I'm still a linux newbie.
Cadillac Ferd 9th July 2008, 18:44 Quote
Thats neat, vi is cool and all but lets get real folks, do we need any other editors when the good folks behind KDE have already provided us with the beautiful program that is Kate?
Gareth Halfacree 9th July 2008, 22:03 Quote
Quote:
Originally Posted by Timmy_the_tortoise
I don't appreciate how this article assumes that I know what "vi" and "Emacs" are..
I don't know... You link every possible technical term in an article and people say it's "distracting". You link a minimum of terms, and people complain that it doesn't provide enough background information.

Damned if you do, damned if you don't.
Woodstock 10th July 2008, 00:09 Quote
Quote:
Originally Posted by cyrilthefish
Quote:
Originally Posted by TomH
Oh great, now I can get trapped in my browser as well as my terminal.. :p

Obligatory bash quote:
Quote:
<Aoi-chan> everyone's first vi session. ^C^C^X^X^X^XquitqQ!qdammit[esc]qwertyuiopasdfghjkl;:xwhat

:D
I never got past that stage :D

First thing i do on any linux system is make sure nano is installed ;)

the first thing i do is ensure vim is installed, and then vim-syntax options. So any chance of bit setting up jvsi in an optional format (if possible)
bowman 10th July 2008, 01:02 Quote
Quote:
Originally Posted by Gareth Halfacree
Quote:
Originally Posted by Timmy_the_tortoise
I don't appreciate how this article assumes that I know what "vi" and "Emacs" are..
I don't know... You link every possible technical term in an article and people say it's "distracting". You link a minimum of terms, and people complain that it doesn't provide enough background information.

Damned if you do, damned if you don't.

It's because it's *nix.
Techno-Dann 10th July 2008, 03:08 Quote
Quote:
Originally Posted by Cadillac Ferd
Thats neat, vi is cool and all but lets get real folks, do we need any other editors when the good folks behind KDE have already provided us with the beautiful program that is Kate?

Absolutely we do - what do you turn to when you're working on a server OS with no GUI, no functioning network connection, the world's weirdest disk formatting system (read as: no floppies, USB drives, or CDs) and need to edit config files to get the thing to work? Command-line text editing is a necessity at times.

But yes, my first several tries at vi looked rather like:
Quote:
<Aoi-chan> everyone's first vi session. ^C^C^X^X^X^XquitqQ!qdammit[esc]qwertyuiopasdfghjkl;:xwhat
(thanks, TomH - very good find)
Log in

You are not logged in, please login with your forum account below. If you don't already have an account please register to start contributing.



Discuss in the forums

More About...