Backspace ended up triggering the browser's back action though. Other than that, this is really nice.
Edit:
After looking at the source, this seems to make use of emscripten to reuse Vim's existing source code. This really makes me wonder what other cool things we can bring over to the client side.
The “backspace = back” behavior of Firefox is only enabled by default on Windows. The behavior is controlled by the about:config setting `browser.backspace_action` (http://kb.mozillazine.org/Browser.backspace_action).
Not on Linux, where the 'previous page' action is mapped to Alt-left by default. After being initially frustrated, I got really used to Alt-Left for going back.
The reasoning behind it is pretty smart too, because numerous times backspace can result in the loss of data, like when you're filling up a form and you hit backspace outside of a text box.
Indeed, I like the 'alt-left' keyboard shortcut, though I especially like it because it does the same thing in both Chrome and Firefox on both Windows and Linux! Yay for consistency!
I'm normally unimpressed by applications ported to javascript. However, this actually has me excited. I would love to be able to edit all my Dropbox text files with a web interface. If anyone here works for Dropbox, I beg you to integrate this!
Given the size of the "compiled" file, i'd say it's a bad idea . A better idea would be whatever js editor with a vim mode, not c code compiled with emscriptem like this one.
PatientZero's law:
Any submission to Hacker News about a novel Java script program containing a reference to Atwood's law will contain a reference to tlrobinson's law.
Lots of comments seem to expect some further web integration with various services but this looks like more of a prototype/proof-of-concept using emscripten.
And this one is a test-bed for new JS language features (or at least meant to be - don't know how far along it is): https://github.com/mozilla/narcissus
While this is impressive, I find it surprisingly slow compared to much more demanding applications with bigger code bases compiled via Emscripten. Any ideas why?
Well, I don't know what you mean by slow, but it could be the use of setTimeout() every 10ms to simulate[1] Vim's synchronous busy-wait is affecting responsiveness.
Lu mentioned[2] on vim_dev that it was necessary to write a hack for this portion.
Yeah, I hit this same road-block when trying to port vim to JS and gave up because it didn't seem worth it after that. If only vim ran a regular event loop, it would have been such an easy port, compared to what they had to do here. When figuring out how I could overcome it, I remember reading accounts of KDE developers trying to embed vim into their widgets and failing over and over. In the end, there was a solution to "embed" vim with some special IPC the netbeans IDE developers put into vim, but you had to run vim as a separate process for that to work - which is not possible on the web as it stands today. The numerous synchronous busy-wait loops in vim killed all approaches I had considered, so kudos to these guys for figuring out a way, even if it's slow.
There's an event loop patch on vim_dev being played with. Maybe in the next 12 months we will see some action with that approach or the other "timers" approach submitted (and ignored by Bram) by the floobits devs.
106 comments
[ 4.5 ms ] story [ 137 ms ] threadBackspace and ESC not working, so after I enter a mode I'm stuck in it forever.
Edit: After looking at the source, this seems to make use of emscripten to reuse Vim's existing source code. This really makes me wonder what other cool things we can bring over to the client side.
(I'm a little surprised by this because I've seen so many complaints about it leading to data loss.)
The reasoning behind it is pretty smart too, because numerous times backspace can result in the loss of data, like when you're filling up a form and you hit backspace outside of a text box.
(I'm a little surprised by this because I thought all browsers used backspace for back)
Hmm, actually it seems all the motions I tried didn't work :-(
http://vimdoc.sourceforge.net/htmldoc/motion.html#word-motio...
One idea could be to bundle it with haste[1] or similar.
[1] https://github.com/seejohnrun/haste-server
Not really sure how it all works, I only took a quick look.
https://github.com/NickTomlin/pocketvim
Edit: And it’s _written_ in JS, not ported.
http://www.codinghorror.com/blog/2007/07/the-principle-of-le...
And tlrobinson's Law (or corollary?): Any submission to Hacker News about a novel JavaScript program will contain a comment referencing Atwood's Law.
https://twitter.com/tlrobinson/status/395636386671235072
http://bellard.org/jslinux/
http://www.emacswiki.org/emacs-fr/Ejacs
Ejacs is an Ecma-262 compliant JavaScript interpreter written entirely in Emacs Lisp. It should work in GNU Emacs versions 22 and higher.
http://bellard.org/jslinux/
;-)
Cool nonetheless.
This one is Spidermonkey compiled with Emscripten: https://github.com/jterrace/js.js/
And this one is a test-bed for new JS language features (or at least meant to be - don't know how far along it is): https://github.com/mozilla/narcissus
Lu mentioned[2] on vim_dev that it was necessary to write a hack for this portion.
[1] https://github.com/coolwanglu/vim.js/blob/master/web/vim_lib...
[2] https://groups.google.com/forum/#!topic/vim_dev/AQTHbUHijgg