# Textern: edit Firefox textareas in Kakoune

**URL:** <https://discuss.kakoune.com/t/textern-edit-firefox-textareas-in-kakoune/1133>\
**Category:** Resources\
**Tags:** browser\
**Created:** [July 9, 2020, 8:36am UTC](https://discuss.kakoune.com/t/textern-edit-firefox-textareas-in-kakoune/1133 "2020-07-09T08:36:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Screwtapello](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/screwtapello/32/12_2.png) [@Screwtapello](https://discuss.kakoune.com/u/Screwtapello)\
**Post date:** [July 9, 2020, 8:36am UTC](https://discuss.kakoune.com/t/textern-edit-firefox-textareas-in-kakoune/1133/1 "2020-07-09T08:36:52Z")

</div>

Back in the days when Firefox had single-digit version numbers, there was an add-on called “It’s All Text” that let you edit the contents of a text-area in an external editor, with all your favourite keybindings, etc. Once Firefox replaced its old add-on ecosystem with WebExtensions, that extension died and I’ve been looking for a replacement ever since.

I recently found an add-on called [Textern](https://addons.mozilla.org/en-US/firefox/addon/textern/) that does the same thing, but (in accordance with the WebExtensions security architecture) it comes in two parts - a Firefox extension that can be installed with a single click, and an external helper script written in Python with all the dependency hassle that implies.

So, I wrote [my own external helper](https://gitlab.com/Screwtapello/textern-helper) in Rust, so I can distribute a single statically-linked binary that basically Does The Right Thing. My project’s README has basic installation instructions if you’re interested - although I should note it currently only works on Linux, and I’ve only made a pre-built binary for x86\_64. I created issues discussing [macOS support](https://gitlab.com/Screwtapello/textern-helper/-/issues/1) and [Windows support](https://gitlab.com/Screwtapello/textern-helper/-/issues/2) if anybody wants to help with those.

Specifically to make it work with Kakoune, I configured the external editor command to be:

```json
["x-terminal-emulator", "-e", "kak", "%s", "+%l:%c"]

```

…because I’m using Debian and `x-terminal-emulator` is Debian for “my preferred terminal emulator”. It shouldn’t be difficult to figure out what to use on your system, especially if you’ve had to set the `termcmd` option in your kakrc.

---

<div class="post-metadata">

**Author:** ![JJK96](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/jjk96/32/305_2.png) [@JJK96](https://discuss.kakoune.com/u/JJK96)\
**Post date:** [July 9, 2020, 9:57am UTC](https://discuss.kakoune.com/t/textern-edit-firefox-textareas-in-kakoune/1133/2 "2020-07-09T09:57:57Z")

</div>

Krabby [https://krabby.netlify.app/](https://krabby.netlify.app/) also has a feature to open in an external editor. Kakoune is supported.

---

<div class="post-metadata">

**Author:** ![alexherbo2](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/alexherbo2/32/1140_2.png) [@alexherbo2](https://discuss.kakoune.com/u/alexherbo2)\
**Post date:** [July 9, 2020, 12:59pm UTC](https://discuss.kakoune.com/t/textern-edit-firefox-textareas-in-kakoune/1133/3 "2020-07-09T12:59:03Z")

</div>

[Krabby](https://krabby.netlify.app) has a similar feature by combining [webextension-editor](https://github.com/alexherbo2/webextension-editor) and [webextension-shell](https://github.com/alexherbo2/webextension-shell).

The [native messaging part](https://github.com/alexherbo2/webextension-shell/blob/master/host/src/webextension-shell.cr) is in [Crystal](https://crystal-lang.org), and is supported on Linux, macOS, but not Windows – [Krabby – #23](https://github.com/alexherbo2/krabby/issues/23).

You can set the `editor` option to open Kakoune in [Alacritty](https://github.com/alacritty/alacritty) or another terminal:

```auto
alacritty --class 'Alacritty · Floating' --command \
  kak "${file}" -e "
    select ${anchor_line}.${anchor_column},${cursor_line}.${cursor_column}
  "

```

---

<div class="post-metadata">

**Author:** ![TeddyDD](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/teddydd/32/21_2.png) [@TeddyDD](https://discuss.kakoune.com/u/TeddyDD)\
**Post date:** [July 14, 2020, 11:37am UTC](https://discuss.kakoune.com/t/textern-edit-firefox-textareas-in-kakoune/1133/4 "2020-07-14T11:37:28Z")

</div>

Your helper is really handy. Thanks!
