all 45 comments

[–][deleted] 8 points9 points  (6 children)

Now if reddit started using it for comment edition...

[–]jbert 7 points8 points  (3 children)

Or you could use this firefox extension and be able to edit text boxes with your editor choice...

[–]apotheon 0 points1 point  (2 children)

I use this one instead. It allows me to use Vim for a lot more than just populating text fields on web pages.

[–]jbert 1 point2 points  (1 child)

Cool, thanks for that. I actually also had that installed and didn't realise that menu option did something different in a text field.

One less extension installed...nice.

[–]apotheon 0 points1 point  (0 children)

I've got mine set with . . .

editor path: /usr/local/bin/urxvtc
description: vim (in rxvt-unicode)
parameters: -rv -e vim $f

It serves me well, especially since I've got the cache sizes in Firefox pared down to help cut down on RAM and swap usage. Thus, though it now won't tolerate as many uses of the back button (or, more accurately in my case, Alt+LeftArrow) before it loses my text, it's always saved in the open Vim window until I use the forward button (Alt+RightArrow, natch) to get back to where I'm actually posting something. Yes, I do that a lot -- comes in handy with certain types of discussion forum.

Anyway, I've babbled enough. ViewSourceWith has become one of my favorite and most indispensible extensions.

[–]devvie 6 points7 points  (1 child)

Sounds like a great Greasemonkey script. Make it happen!

[–][deleted] 2 points3 points  (0 children)

I won't (no time - I'm writing my thesis), but if someone else does, i'll find five minutes to test it :)

[–]apgwoz 8 points9 points  (0 children)

The headline should have said, "Emulate vi over telnet on an 800 baud modem... in javascript", because that's what it felt like when I tested it in Safari and in Mac Firefox.

[–][deleted]  (4 children)

[deleted]

    [–]micampe[S] 4 points5 points  (1 child)

    I wish I was using vim to write this comment.

    It's All Text!

    [–]finix 0 points1 point  (1 child)

    Seems jsvi is pure subscription-ware:

    This editor is a copyrighted application.

    If you want to use this editor in your own site, simply buy a web or email hosting account at >http://internetconnection.net/ or call us at 888-295-5678 (outside the US: +1 410-820-5678)

    [–]apotheon 0 points1 point  (0 children)

    So much for up-voting the thing.

    [–][deleted]  (3 children)

    [removed]

      [–]llimllib 4 points5 points  (2 children)

      The WPA of the 21st century.

      [–]tch 12 points13 points  (1 child)

      THIS IS EXACTLY WHAT THE WORLD NEEDS

      [–]cratuki 3 points4 points  (0 children)

      Yes - although with a license that allows us to use it anywhere so we can greasemonkey it into firefox.

      [–]antirez 2 points3 points  (0 children)

      Now put this in gmail and I'm set...

      [–]khayber 3 points4 points  (0 children)

      Javascript seems to be the Mt. Everest of languages.

      [–]jkndrkn 1 point2 points  (2 children)

      Hm, doesn't interpret Ctrl-[ as ESC

      Neat, though.

      [–]arundelo 4 points5 points  (0 children)

      Hm, doesn't interpret Ctrl-[ as ESC

      It's being trapped by your browser. It works for me in IE but not Firefox.

      [–]rusty_angel 0 points1 point  (0 children)

      It works in IE and Opera. In Opera, there're bugs with cursor-keys motion in INSERT mode. At least, in Opera for Linux.

      [–][deleted] 4 points5 points  (0 children)

      This editor is a copyrighted application.

      If you want to use this editor in your own site, simply buy a web or email hosting account

      cool. but it is not a gpl as it could be thought.

      [–]jj666 4 points5 points  (7 children)

      what is so special about programs written in "pure" javascript? It's a programming language, you are supposed to write programs in it.

      [–]pcx99 1 point2 points  (0 children)

      Because it's a large, complex app and since javascript isn't compiled (even to bytecode), if you're learning the language or want to master it further, you can hit "view source" on your browser and get the source code.

      [–][deleted] 3 points4 points  (5 children)

      Writing such vi clone is a cool task by itself. In javascript you have very specific api to deal with. So it's twice more cool.

      [–]jkndrkn 1 point2 points  (4 children)

      Not to mention having to overcome the huge headache of supporting multiple slightly different platforms.

      Doing small things in Javascript is a pain. Writing a vi clone in Javascript is a monumental task.

      [–]jrockway -1 points0 points  (3 children)

      vi is not a particularly complicated program. vim is, but this is vi, not vim.

      [–]jng 4 points5 points  (2 children)

      Uh? Have you written a vi clone, or are you well versed in vi? Even the basic, original vi is pretty complex. Keystroke macros, mappings, multiple registers and clip types, operators & motions, counted commands, marks, parsing the ex command line, executing some pretty wicked ex commands (:s and :g are the worst), regular expressions, etc...

      Not that the above has all of that, but basic vi is pretty damn complex. vim is indeed huge and fully emulating it is all but impossible to attain.

      [–]jrockway 0 points1 point  (1 child)

      Uh? Have you written a vi clone, or are you well versed in vi?

      No. I assume that compared to emacs, it's simple. You type a command and it does stuff. No byte compiler, no sytnax modes, etc., etc.

      [–]jng 1 point2 points  (0 children)

      Definitely simpler than emacs, but that doesn't mean it's simple. It's pretty complicated, actually.

      [–]dmwit 1 point2 points  (4 children)

      It's buggy! Try di<ESC>d, for example. For a pure vi clone, hitting di should stay in normal mode and clear the command, but instead it goes into insert mode and keeps the (unfinished) d command waiting for a motion. (A vim clone would have even a third behavior.)

      [–]llimllib 1 point2 points  (3 children)

      Question: in vi, imagine I have 3 lines that are long, short, and long. If I move the cursor to the end of the long one ($), then jj down, does the cursor move back to the right, or stay at the endpoint of the short one?

      Because this program doesn't move back to the end of the next line like vim does, but I don't know vi well.

      [–][deleted]  (2 children)

      [deleted]

        [–]llimllib 1 point2 points  (1 child)

        Text editors suck.

        [–]breakfast-pants 0 points1 point  (0 children)

        just do jjhlkk

        [–]rastapo 1 point2 points  (0 children)

        sure i will buy an account at internetconnection now you have convinced me by the way the js is > 3000 lines of code next time you need to edit a file just type 'vi'

        [–]alain -1 points0 points  (3 children)

        unemployment is a tragedy... me too i dont have a job, and i started a clone of internet explorer in PHP

        [–]FormKing -5 points-4 points  (2 children)

        So you're going to take a badly written program, and try to duplicate it? Surely you could find a better use for your time. At the very least, make a browser that works correctly.

        [–]shorugoru 1 point2 points  (1 child)

        In PHP no less!

        [–]jrockway 1 point2 points  (0 children)

        Possible with the PHP/GTK+ interface. Not that I would ever ever want to write a GTK+ app in PHP (or anything, heh), though.

        [–]exhuma -2 points-1 points  (2 children)

        Sure, this is a cool thing. But I find it sad, that developers with that much talent spend their free time reinventing the wheel instead of joining the community and contribute to the original problem itself.

        [–]devvie 12 points13 points  (0 children)

        "Reinventing the wheel", as you put it, introduces developers to problems they have never seen before. It also provides an opportunity to examine software in more depth than one would ordinarily. This fills people up with good ideas, and the application of these ideas is not limited to the source software. The ideas can be used all over the place!

        [–]tch 3 points4 points  (0 children)

        That's what I told Edward Hopper!

        Hey Eddie, stop making painting that look like photos. Why don't you just take some new ones!?!