
Wasavi – a browser extension that transforms TEXTAREA elements into a VI editor - yankcrime
http://appsweets.net/wasavi/
======
kitsunesoba
It’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.

~~~
aplaice
If 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-...](http://askubuntu.com/questions/124815/how-do-i-enable-emacs-
keybindings-in-apps-such-as-google-chrome/233539#233539)

------
arjie
I'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.

------
nine_k
And 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
Great, now I can choose which bullet to get shot with.

Coming up next, Edlin plugins

------
bch
Not 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
Or 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
Now 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
What is the emacs for? I'm so confused.

~~~
LukeShu
Emacs can serve as a terminal multiplexer, which is the most obvious thing for
Emacs to provide in that setup, though as mikekchar said, it does have a lot
to offer.

I never quite got the people who run Emacs in screen/tmux; emacs can already
do that!

~~~
fennecfoxen
Is there an emacs equivalent of screen -r? (or, if you want to be exciting,
-x?)

~~~
tomjakubowski
Sort of. You can run emacs as a daemon and attach to it with emacsclient. Then
when you want to detach, you just C-x C-c like usual, or disconnect and let
the emacsclient process die. You have to remember to run emacs as a daemon up
front, though.

You could also run emacs inside something like dtach or abduco [1], which are
a "session managers" like screen or tmux but without the multiplexer.

[http://www.brain-dump.org/projects/abduco/](http://www.brain-
dump.org/projects/abduco/)

~~~
LukeShu
Yes, I was referring to `emacs --daemon`/`emacsclient`.

If you run `emacsclient -a ''` then it will automatically run `emacs --daemon`
for you (if it isn't already running), so that you don't need to run it up-
front.

------
OvidNaso
I 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))

------
imiric
Perhaps 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.

------
vanous
Finally 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
I'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.

------
tedmiston
Presumably 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
It'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/)

------
fiatjaf
I'm testing my wasavi installation right now. It is great, but it doesn't have
VISUAL mode.

But it has search and replace.

~~~
reirob
I have visual mode - pressing v and then moving the cursor to select text. I'm
on Firefox on Ubuntu 14.04.

~~~
fiatjaf
I'm sorry. I have it too, it is called BOUND mode. What I don't have is VISUAL
BLOCK mode.

------
cossatot
Doesn't seem to work on IPython Notebooks, unfortunately (maybe those fields
aren't TEXTAREAs?).

------
michaelx386
This 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.

------
TazeTSchnitzel
Ooh, 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.

------
DonHopkins
Does :q! terminate the browser? That's the only vi command I know.

~~~
organsnyder
Ha. Nope—it exits vim mode.

------
cyphar
Why not just use Vimperator?

~~~
amjo324
I 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).

------
dvcrn
Been using wasavi for quite a while now and really like it. The vim emulation
is pretty dang good!

------
__Joker
Yes, Vimium for chrome and Wasavi for the text boxes, makes life little more
vim complete.

------
james2vegas
s/VI/vim/ in case you were wanting to use uu in a standard way

