6 ms·
Wasavi – a browser extension that transforms TEXTAREA elements into a VI editor
- cyphar 11y agoWhy not just use Vimperator?
- 0942v8653 11y agoFor one, this is on-demand and doesn't rewrite the default keybindings of the browser. It is nice for anyone else using your browser where they can ignore it entirely. It's a tradeoff and each has their benefits.
- amjo324 11y agoI can't live without vimperator nowadays. It's the only thing stopping me from switching to Chrome from FF (and yes, i know there are other similar vi extensions for Chrome but none seem as good as vimperator for FF).
- deleted 11y ago[deleted]
- midgetjones 11y agoDoes Vimperator allow for vi mode in textareas? I thought it was for general browser control.
- michaelx386 11y agoJust tested this and Vimperator does allow vi mode in text areas if control+t is pressed. It's not as slick as wasavi but it works. There's also the option of launching an external gvim window when control+i is pressed inside a textarea, which is a cool feature for more in depth editing tasks.
- cossatot 11y agoDoesn't seem to work on IPython Notebooks, unfortunately (maybe those fields aren't TEXTAREAs?).
- tedmiston 11y agoPresumably inspired by the similar post today doing this with Atom for Chrome. https://news.ycombinator.com/item?id=11022356 https://news.ycombinator.com/item?id=11022356
- icebraining 11y agoIt's All Text![1] has existed for almost a decade. The interesting thing about this addon is that the Vim UI is actually integrated in the browser. [1] https://addons.mozilla.org/en-us/firefox/addon/its-all-text/ https://addons.mozilla.org/en-us/firefox/addon/its-all-text/
- bch 11y agoNot directly applicable, but elinks[0] allows ^T (ctrl-T (capital 'T')) while editing a textarea to launch $EDITOR. It's really nice. Edit: in some instances, it's incredibly useful. For example it makes some cases of gmail more usable/enjoyable than via Firefox. I get all the power of vi and full access to my running system, so I can easily inline code segments or log files into my messages, and not lose editor focus if I bump the mouse, etc :P [0] http://elinks.or.cz/ http://elinks.or.cz/
- jethro_tell 11y agoOr mutt if that's where you are going. I can't tell you how many emails I've accidentally sent from the browser that end in :wq
- bch 11y agoNow I'm jokingly imagining running Emacs and "term" mode with mutt or elinks and running vi to do the editing. It sounds silly on the surface, but I think is a testament to the composability of the tools. Edit: tested Emacs/elinks, and it works if the TERM is changed from eterm-color to vt100. Hooray for text and Unix.
- jethro_tell 11y agoWhat is the emacs for? I'm so confused.
- bch 11y agoI did say "jokingly imagining" above. "Emacs is a great operating system, lacking only a decent text editor."[0] [0] https://en.wikipedia.org/wiki/Editor_war https://en.wikipedia.org/wiki/Editor_war
- mikekchar 11y agoAlthough the OP posted himself, one thing I try to explain to people who don't use Emacs very much is that instead of thinking of it as an editor with a Lisp extension language, it's better to think of it as a Lisp environment with a built in editor. And although people jokingly refer to it as an OS (and even the kitchen sink is included -- as an icon), it's really more like a shell. You have a windowing environment, you can integrate other programs including terminal shells, debuggers, etc, etc. Finally, because it is a full Lisp environment, you have 30+ years of accumulated Lisp programs that you can run (some of which have no equal on any platform). I used Emacs for 20 years and while I've strayed away from it (got interested in Vim), I'm slowly making my way back. Not for the Emacs keybindings (which are fine), but for the entire elisp ecosystem. So in a way the OP's imaginings are not so far off (although I don't think you can actually run vim inside emacs -- you will need to use Evil mode instead ;-) ).
- nine_k 11y agoAnd for the rest of us, here's a Firefox extension that makes emacs shortcuts work in text areas or everywhere: https://addons.mozilla.org/en-US/firefox/addon/firemacs/ https://addons.mozilla.org/en-US/firefox/addon/firemacs/ Unfortunately, many web apps assume the CUI bindings. Having to paste via Ctrl+V when you have remapped the paste hotkey everywhere is merely a nuisance. Not being able to use other webapp shortcuts because they are not defined in CUI but are taken in vim / emacs mode can be a show-stopper. (This is why I limited myself to remapping copy and paste only.)
- SixSigma 11y agoGreat, now I can choose which bullet to get shot with. Coming up next, Edlin plugins
- digi_owl 11y ago> Unfortunately, many web apps assume the CUI bindings With some going even beyond that. If i use ctrl-pgup/pgdn while browsing G+, the press will both swith tabs and bump the G+ page up or down. And over at Youtube, hitting home will set the video back to zero if it has "focus". And i have this habit of using home to get to the top of the page after scrolling down to read comments (yep, i hate myself).
- TazeTSchnitzel 11y agoOoh, this is like a newer and actually working Pterosaur. I was just now struggling to get that to work (it's been unmaintained for a year, so it's probably just broken), maybe I'll try this out instead.
- dvcrn 11y agoBeen using wasavi for quite a while now and really like it. The vim emulation is pretty dang good!
- kitsunesoba 11y agoIt’s worth a mention that although it’s not all that widely known, all native text fields under OS X come with a subset of emacs key binds built-in, and this includes web page text fields in Safari, Chrome, and Firefox so if you like emacs keybinds and run OS X you’re ready to go right out of the box, no need to install anything. See http://jblevins.org/log/kbd http://jblevins.org/log/kbd for further detail.
- bilalq 11y agoThanks for sharing that! I'd never known that was the case. I do prefer vi bindings over emacs, but I can make do with these. This'll be just a little life-changing.
- aplaice 11y agoIf you're on Linux and running GTK-{2,3} applications, you can also have emacs key-bindings in your text entry fields (in firefox, nautilus, gmrun etc), with a small amount of work. See [1] for details. Using the pre-defined emacs keybindings has the disadvantage that they override the normal (CUA), which is sometimes inconvenient (especially since AFAIK gtk doesn't allow you to use multiple-chord keybindings, so for example, C-x h is out). You can go around this by copying /usr/share/themes/Emacs/gtk-3.0/gtk-keys.css to (say) ~/.themes/my-new-theme/ and /usr/share/themes/Emacs/gtk-2.0-key/gtkrc into your ~/.gtkrc-2.0 and replacing all occurrences of <ctrl> with (say) <super> or <hyper>. For gtk-3 you then also need to run gsettings set org.gnome.desktop.interface gtk-key-theme "my-new-theme" [1] http://askubuntu.com/questions/124815/how-do-i-enable-emacs-keybindings-in-apps-such-as-google-chrome/233539#233539 http://askubuntu.com/questions/124815/how-do-i-enable-emacs-...
- arjie 11y agoI've been using this for a few months. My favourite thing is that it supports `ex` commands, and if you have a cheap pedal from Deal Extreme or Alibaba or whatever, you can get your Vim toggle powers real easily. I programmed mine to emit `C-f` and did just this: map <C-f> a map! <C-f> <Esc> It's not fancy, but it lets me toggle between Insert and Normal in a useful enough way. One unfortunate thing is that being in Wasavi mode won't get your auto-save in Gmail, etc. I made that mistake once months ago and disabled it there ever since. Very impressed by this software.
- OvidNaso 11y agoI use pentadactyl with firefox which allows me to <C-i> in a text area which launches emacsclient (running in daemon mode) and sends the text back when I save. no mouse! Here is a short video of how it works: https://youtu.be/_ZoABZ8muy0 https://youtu.be/_ZoABZ8muy0 (huge gif http://imgur.com/iXMeZDj http://imgur.com/iXMeZDj)
- vanous 11y agoFinally and extension that seems to work for me: it doesn't open external window and doesn't force me to save to make sure changes are populated back to the browser (i have easily multiple tabs with half written texts opened simultaneously). I would love for this to be available for Thunderbird as well. :wq :)
- yagrum 11y agoI've been using cVim for page navigation and Wasavi for editing text boxes for a while now and have been really happy with the combination. I still use an external editor for more involved edits/when I'm feeling paranoid, but Wasavi is great for just about everything else.
- __Joker 11y agoYes, Vimium for chrome and Wasavi for the text boxes, makes life little more vim complete.
- fiatjaf 11y agoI'm testing my wasavi installation right now. It is great, but it doesn't have VISUAL mode. But it has search and replace.
- michaelx386 11y agoThis is great, one thing I'd like to do is map j and k to gj and gk to make it easier to move between wrapped lines. It kind of works in Wasavi but it doesn't seem to move directly above or below the previous position.
- DonHopkins 11y agoDoes :q! terminate the browser? That's the only vi command I know.
- organsnyder 11y agoHa. Nope—it exits vim mode.
- james2vegas 11y agos/VI/vim/ in case you were wanting to use uu in a standard way
- imiric 11y agoPerhaps I'm being too paranoid, but has this extension been externally vetted? I'm reluctant to give access to all data I type in input boxes to a developer I'm not familiar with. While they claim it works only on textarea elements, what's stopping them from reading other input elements, including username / password fields? It seems like an awfully convenient credential collector.