vimperator: Using external editor (e.g., vim) to edit Stack Overflow text

Utilities like vimperator allow editing content of HTML form fields in an external editor.

With vimperator there is shortcut Ctrl+I which, when in an edit box, opens the text in an external editor.

In the past, it was possible to use this in Stack Overflow. Since the introduction of more editing features, however, Ctrl+I is not opening the external editor, but inserts *emphasized text*.

Is there any way configure vimperator to start an external editor for editing Stack Overflow text?


Stack Overflow and other Stack Exchange sites, like many other websites with embedded editors, bind various keyboard chords to editing commands. These are sometimes called access keys (if you want to do a web search) and are bound when the page is loaded. In your case, Vimperator's default keymap for editing a HTML text area in an external editor, Ctrl-i, is overridden. Instead of its default operation it inserts *emphasized text*. To get around this you can add a new mapping to your .vimperatorrc. I have used

inoremap <Leader>i <C-i>

My <Leader> key is -, so with the focus on a HTML text area I use -i begin editing in an external editor.


It is clear from the question that you have used this feature before, but for those who haven't, the option that controls which external editor to use is 'editor'. For gVim/MacVim, use the -f flag for "foreground", preventing that Vim forks its own process (and loses its association with the edited text area). See :help 'editor'. I use MacVim and the two relevant lines of my .vimperatorrc therefore read:

set editor="/usr/local/bin/mvim -f"
inoremap <Leader>i <C-i>