philc/vimium — pull request #959 by ramiroaraujo (2013-11-21 15:44:42+00:00)
Title: Vimium Toggle shortcut

I know there's an _i_ command to enter insert mode and essentially disable the plugin, until hitting ESC. That's no good for apps like Gmail, where you want Vimium disabled almost always, and if it were enabled but in insert mode, you would constantly hit ESC or shift + ESC to jump back and forth panels.

This PL adds an always present shortcut (Cmd + ESC or Windows + ESC, see below) to enable or disable Vimium regardless of the current configuration. It's a simple switch. As a bonus, it updates the icon in the current tab to indicate the current enabled or disabled state. A small visual bug I didn't find much too important: if you leave a temporarily switched tab and come back, you'll see the icon Vimiums sets without honouring the current switch. Lastly, the switch will remain active until page reload, when it will be set back to enabled or disabled based on your Vimium config.

About the shortcut, I'm not thrilled about it, but it seems to work. I understand that Vimperator uses Shift + ESC to do this kind of switch, but Shift + ESC collides with Gmail's way of leaving panels opened but moving focus back to email list, and I basically did this for Gmail :)

Hope you like it!
Ramiro