5 ms·
Vi in JavaScript, in your browser
- manish 17y agoWow, simply great. It would be nice to open files in your computer and use them. I could not open any file by :n filename command. Also record command, which is very useful is missing. I am not sure for what this can be used?
- past 17y agoIt can be used for adding a vi mode to any web page editing scenario you might have a need for. If you want to edit local files from your browser, I've made a Firefox extension that does just that: http://past.github.com/despin/ http://past.github.com/despin/ It doesn't have a vi mode (yet) and lots of other things, but I'd be interested to see if people found it interesting and useful.
- afed 17y agoGood job, now learn a real language.
- antirez 17y agoNice, what is missing is a way to have vim (or a decent approximation) in every text area, embedded. There are different solutions and extensions but nothing comparable to vim running in the text area box. While I'm at it, another thing I miss so much is the ability to tell Firefox (or other browsers) that I write in two languages (Italian and English) so it could automagically switch spell correction dictionary auto sensing the language. This problem is common to at least half the people living in Europe.
- nirmal 17y agoThis comment made me realize that I've been using emacs commands for textareas in Safari/Firefox without thinking about it. Most of them seem to be there, at least for moving around within the text. Does this just work under OS X?
- antirez 17y agoI think this works everywhere. Being vim a modal editor is not possible to "hide" vim bindings :)
- epe 17y agoA lot of them do "just work", and the rest can be made to. See http://www.hcs.harvard.edu/~jrus/site/Cocoa%20Text%20System.html http://www.hcs.harvard.edu/~jrus/site/Cocoa%20Text%20System.... for the full story, or create a ~/Library/KeyBindings/DefaultKeyBinding.dict file that contains something like: { "~d" = "deleteWordForward:"; "~f" = "moveWordForward:"; "~b" = "moveWordBackward:"; } The "~" means "Meta"; all this does is set up M-d, M-f, M-b to work like they do in Emacs.
- stcredzero 17y agoNice, what is missing is a way to have vim (or a decent approximation) in every text area, embedded This sounds like something OS X or another ambitious and slick operating system should provide: the ability to use the text editing engine of your choice in every textarea on your machine.
- brazzy 17y agohttp://ui18.gamespot.com/2897/whywouldyoudothat_2.jpg http://ui18.gamespot.com/2897/whywouldyoudothat_2.jpg
- jrockway 17y agoAnime image macros! Yes! I think HN is finally mainstream.
- yeahit 17y agoAs a VIM user, these things irritated me: 1) I cannot delete the end of a line with this thing. Is that normal? Im only used to VIM so this might be a VI thing. 2) CLTR+ does not scale up the font size
- cturner 17y ago> Is that normal? Yes. You're not "meant" to be able to backspace over content that wasn't added in your current transaction. Which is really inconvenient, because if you delete things when you're in command mode then it overwrites what's in your buffer, which is often convenient. In vim you can simulate this by doing :set compatible
- rudenoise 17y agoAre there any other similar projects out there? I was thinking about attempting a VIM plug-in for Bespin (https://bespin.mozilla.com/ https://bespin.mozilla.com/) that could also be used as an FCK/TinyMCE style textarea add-on.
- mhansen 17y agoIt's not picking up escapes (Google Chrome 4.0.221.6)
- MikeHawk 17y agoNot recommended for Vimpertator users. I just acciendentally quit my browser session without knowing it.
- mjgoins 17y agoIt crashed on me (or rather, became totally unresponsive) when I deleted the whole buffer with a "dG" command. running iceweasel 3.0.6
- stcredzero 17y agoI hope that this was done with a C compiler that can target Javascript!