Vimium: Add the ability to temporarily toggle vimium on/off for a page

Created on 30 Dec 2011  ·  28Comments  ·  Source: philc/vimium

It would be nice if I could do a key combination that would disable vimium on the current page temporarily; furthermore it would be nice to have an editable list of domains in the settings that vimium would not run on.

Most helpful comment

@smblott-github As far as I can see the original feature requested is still not available. It isn't possible to enable vimium on a page where it is currently disabled without reloading the page. Being able to toggle it by clicking on the vimium extension icon would be useful.

All 28 comments

There is already an editable list of domains in the settings that vimium does not run on.

Regarding temporarily disabling vimium, does typing "i" (insert mode) fit the bill?

@philc I dig your suggestion. It doesn't happen often, but I'll sometimes find myself on a site that has its own keyboard navigation, and it always goes splat with vimium. Yes, the simple solution is to add an exception, but that's a disruption to the browsing experience (and oh so much commitment from a site I'll only visit once).

I tested it out, and Insert mode definitely does the job on super AJAXed sites like GMail. Thanks!

@DeadDork do you find that GMail sometimes causes Vimium to leave insert mode? For example, suppose you have two chat windows open.

Hit "i" to enter insert mode
Enter C-. (GMail shortcut to focus on next window, in this case chat 1)
Enter C-. (focus chat 2)

At this point for me, Insert mode is no longer invoked. Any ideas why this is happening?

Is GMail's change focus field somehow triggering an "escape" like event that's canceling insert mode?

Similarly, most times (but not always) hitting "/" to jump to the GMail search bar while in insert mode will pull me out of insert mode.

@philc I'd love it if in addition to insert mode we there was another mappable keystroke (probably a pretty fancy chord) that would toggle vimium to off, and stay off, until it was toggled back on. That would let me use escapes and things like that in GMail without vimium sometimes canceling insert mode. This seems similar to #186

The insert-mode workaround works, but it would be very nice to have a disable feature. Vimperator on Firefox uses Shift+Esc, which is super convenient for sites like Google docs. Shift+Esc toggles Vimperator on and off, and this would be great for Vimium, especially for sites that use Esc as a hotkey (HTML5 games and whatnot).

@beatgammit that seems like a pretty nice feature. I wonder how much code you'd have to refactor though...

@dankessler I'm not familiar with the vimium code-base, so I have no idea. It should just be as easy as:

if (shift && escape) enabled = !enabled;
if (!enabled) return;

I'm also not familiar with Chromium extensions, so it could be more complicated than this...

I took a look in the code and I found an isEnabled flag. I'll try to implement the feature when I've time and nobody else implemented it.

Just landed a PL with this functionality: https://github.com/philc/vimium/pull/959
Hope you like it!

+1

I reading through the various duplicate issues, one of the main use cases seems to be using this on Gmail. We're going to ship #491 soon; would that alleviate the need for this global toggle, or is the toggle still important even with site-specific mappings?

@philc

It's not just sites like gmail though. I am interested in writing WebGL games, so I play a lot of demos. These demos are frequently on sites that I'll only visit once, so excluding these sites manually is tedious and not exactly what I want to do. Temporarily disabling, however, would solve the problem quite nicely.

Aside from games, sites are getting more complex. I work on an HTML5 app (complete with shortcuts) on an embedded platform, so I frequently need to access the same app on different IP addresses. Just like the game thing, adding exceptions for each of these IP addresses takes far too much effort, and I usually try to just hobble through by going into insert mode (which isn't a real solution).

@philc
Same issue on google doc.

It's certainly not just gmail. Any website has the ability to bind custom shortcuts. Additionally, other Chrome plugins have the ability to map any of these keys. For example, the Vimsert plugin, allows you to open a vim editor within any text area. This does not work with Vimium because both bind to the same keys. I can't imagine a user disabling Vimium for each site that might have a form they could fill out, but I could see a user simply hitting shift + escape and disabling Vimium before using Vimsert. This might seem like an unlikely scenario, but in my opinion it seems likely that Vimium users might have other plugins that provide greater "vim-like" functionality and and would run into these types of conflicts.

This is just one example, but I'm sure there are many others. The bottom line is that I don't think it makes sense to assume the user will have the foresight to know when Vimium will conflict with a site or plugin.

@tandroid1. Perhaps check here?

Edit: Ah, ok. I took a look at vimsert. Your problem is with Escape, yes?

@smblott-github Yes, the escape key is one of the issues, but since it uses the ace vim editor, I would imagine most key bindings would conflict.

@tandroid1 the extension you linked looks like it uses a <textarea>, and so we automatically enter insert mode when it is focused. The only binding in insert more is <esc>/<c-[>, so this should be the only (but significant) clash.

@philc @idf Even though google docs is an excluded page:
https?://docs.google.com/* with * keys excluded, escape still does not work as intended. This behavior resumes back to normal when vimium is disabled.

@drwl. To completely disable Vimium, you should leave the "Keys" empty. Could that be your problem? If not, perhaps open a new issue and explain what you expect to happen and what actually happens.

@smblott-github It's interesting behavior to exclude * (all keys) versus leaving it blank that disables Vimium on a page. Nonetheless leaving it blank works!

Great, @drwl.

We should probably close this issue.
It covers a variety of features and issues which have been implemented since the tread began.
If there are specific issues with specific features, open a new issue.

Thank @drwl @smblott-github for the fix.

When will there be a new vimium release for this fix?

@idf If you want to turn off Vimium for Google docs, just leave the exclude keys field blank.

screen shot 2015-08-18 at 4 04 00 pm

Otherwise are you asking about something else?

@drwl is there a key combination to toggle vimium rather than disable it by URL entirely. I have tried ESC, it works in Google spreadsheet but not in google word.

Even if its disabled the css and js for vimium is spamming my network tab in dev tools.

Even if its disabled the css and js for vimium is spamming my network tab in dev tools.

@philc has raised this previously... #1838.

ah, ok thanks!

@smblott-github As far as I can see the original feature requested is still not available. It isn't possible to enable vimium on a page where it is currently disabled without reloading the page. Being able to toggle it by clicking on the vimium extension icon would be useful.

Another +1 for this. I just uninstalled vimium again because of this issue... insert mode works ok, but it shows the "insert mode" toast. Also, very annoying when making my own webGL games. A simple global temporary-disable would make me happy (effectively a quicker uninstall/reinstall I guess, keeping settings)! I'm gonna try the exclude trick I guess..but it's pretty heavy-weight for a common use case.

Was this page helpful?
0 / 5 - 0 ratings