Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Firefox with Vimperator Vim emulator plugin, but instead of using its / key for searching, I prefer to use regular built-it Find bar, invoked by Ctrl-F.

The problem is, if Vimperator is enabled, when I hit Esc from within Find bar after I'm done searching, Find bar doesn't disappear (as it would, had Vimperator been disabled) because Vimperator intercepts Esc mapping.

So my question is, how can I make Find bar disappear as it normally would, when I hit Esc key?

share|improve this question

With vimperator enabled, typing i+CTRL+f will bring up the find bar. And it's also easy to close it.

Try this command:

:js document.getElementById("FindToolbar").close();

Or create a map: (Add the bellow lines to '~/.vimperatorrc')

noremap <c-s-f> :js document.getElementById("FindToolbar").close();<cr>

inoremap <c-s-f> <esc>:js document.getElementById("FindToolbar").close();<cr>

Thus typing CTRF+SHIFT+f works like charm!

An extra note:

CTRL+f in command mode will bring up the find bar. Whilst CTRL-b will bring up bookmark sidebar. That's the reason I encounter this problem. So some other mappings might be helpful:

cnoremap <c-f> <right>

cnoremap <c-b> <left>

Starting from Gecko 1.9(Firefox 25), use this command instead:
:js getBrowser().getFindBar().close()

share|improve this answer
up vote 3 down vote accepted

Add the following mapping to your ~/.vimperatorrc Vimperator configuration file:

inoremap <Esc> <S-Esc><Esc><S-Esc>

And be sure to restart Firefox to pick up the changes.

Under the covers, it does the following: disables Vimperator key interception, propagates Esc key to Firefox (which closes Find bar), enables Vimperator key interception back, in that order. Note that this mapping is not specific to Find bar only, it applies to all insert mode forms (any text area where you can type in some input), but that's likely what you want anyway.

share|improve this answer
Unfortunatelly it doesn't work on sites like =| – MaikoID Apr 6 '15 at 14:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .