Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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>

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

share|improve this answer
up vote 2 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.