Google-chrome – Edit any text input shown by a browser (mostly Chrome) with Emacs

emacsfirefoxgoogle-chrome

Goal: to edit any text input (mostly text areas, but also single line inputs) shown by web browsers with an external editor, in my case, Emacs. Achieve a high level of comfort.

Whenever I'm browsing and need to write huge texts (editing a wiki, answering an email, writing blog entries) I like to do it in my editor of choice (Emacs). In order to do this I can go the manual route: copy in web browser, paste in editor, edit, copy in editor, paste in browser. What a hassle.

For Firefox I used to have an addon for that, though it got lost somewhere along the way. I've found It's All Text which supposedly works, though I haven't tried it yet.

For Chrome I'm currently using Edit with Emacs which works but has some serious shortcomings. However, I'm perfectly aware of the limitation that a Chrome extension cannot spawn other processes; using Emacs' edit server is therefore probably the only way. But I'm fine with that.

What I really want:

  • The ability to use any Emacs mode, major or minor ("Edit with Emacs" fails this as it is itself a major mode, and you lose the interaction with Chrome if you switch to a different major mode). That way editing e.g. wiki markup language can benefit from Emacs capabilities like syntax highlighting etc.
  • The ability to save the file, or at least, have automatic saves ("Edit with Emacs" fails this as well)
  • Minimum amount of manual work required for handing text over to the editor and back (context menu is fine, shortcut would be better. This is one area "Edit with Emacs" shines)

Any proposals? Thanks 🙂

Best Answer

If you're using firefox, check out Vimperator. If you install it, you can use the web browser just like you normally would, but with a ton of extra keyboard shortcuts. If you are in a text area or text box, you can press Control+i to launch the external editor. Edit your ~/.vimperatorrc to change which editor you want to use (it defaults to gvim).

Related Question