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?
Best Answer
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. WhilstCTRL-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()