Vimium: Exclude all keys except ____

Created on 13 Apr 2015  Â·  18Comments  Â·  Source: philc/vimium

You can easily disable All Keys or Individual Keys for a site, it's difficult to disable All Keys Except Keys x y z. For example, mail.google.com has all keys disabled by default. I would like to use the "f" command from vimium in Gmail. How would I do this? I would have to copy every single Gmail shortcut into the box and take out f which seems very tedious and inneficient.

A better method would be to put a plus sign in front of the keys you want to use from Vimium. ie "+f" would mean "Keep disabling all keys but allow 'f' from Vimium to be used".

closing-lack-of-interest

Most helpful comment

A good use case for this is using JIRA. I use most shortcuts for JIRA (which is a lot), but I'd still like o to search a new tab, and f to follow links. I can type the whole alphabet in the box and that's ok, but a reverse rule would be simpler :)

All 18 comments

I just did exactly this 3 minutes ago. I went through the list of shortcuts and set the gmail-excluded keys to jkhlgGzduryivVabceoOTbB[]m`nNHLKJtxXW<>? (this may not work for you; i've already made other config changes)

I'm not sure OP's proposed solution is the best though. A simpler solution that would cover most cases and not require a bunch of parsing code is: have a switch which changes the field from 'disable these keys' to 'only enable these keys'. That's more the kind of thing you could do in an hour if you knew the vimium codebase.

Some considerations:

  • Does this disable keys with modifiers?

    • If so, there'd be no way to re-enable them; we currently don't recognise these in the passkeys field (although #1368 could be refreshed to fix that).

    • If not, how do we communicate this concisely to users so they're not taken by surprise?

  • If we use a + before exclusive keys, how do you disable a mapping on +?
  • How do we give users this choice on each rule (and allow them to see what choice they've already made) clearly without overrunning the limited space in the icon popup?

    • Maybe a <select> with "disable" and "allow only" as options? Would that be too big?

  • Would a more powerful text-based config like the one in #1188 be an acceptable/good/better alternative?

The actual backend code changes should be reasonably easy, very little would need to change there to support this.

  1. i actually completely forgot about mod keys, so well-spotted. i'm happy
    for the relevant feature to ignore mod keys entirely. trend on web apps
    seems to be towards vim-style keybindings anyway, so that's where we need
    to avoid clashes.
  2. this is another great reason not to use +-syntax. or at least not until
    a user has an actual use-case.
  3. one checkbox labelled 'invert' above, possibly with a 'wtf is this
    shit?' link to documentation.
  4. it would be a way-more-complicated and not-clearly-required alternative.
    "I want to use only a few vimium functions in gmail/twitter/other-app" is
    probably something lotsa power users would want (we have 2 already; and
    total isn't huge to begin with).

I don't oppose fancy text config per se, but is there a simpler feature
request that covers 90% of the cases? given that i'm asking somebody i've
never met to write code for me for (as far as he knows) free, i feel it's
incumbent upon me to check.

On Wed, May 6, 2015 at 6:20 PM, Matthew Ryan [email protected]
wrote:

Some considerations:

  • Does this disable keys with modifiers?

    • If so, there'd be no way to re-enable them; we currently don't

      recognise these in the passkeys field (although #1368

      https://github.com/philc/vimium/pull/1368 could be refreshed to

      fix that).

    • If not, how do we communicate this concisely to users so they're

      not taken by surprise?

    • If we use a + before exclusive keys, how do you disable a mapping

      on +?

  • How do we give users this choice on each rule (and allow them to see
    what choice they've already made) clearly without overrunning the limited
    space in the icon popup?

    • Maybe a