Search code examples
shortcutbrowser-extensionvimium

How to Remap a Key to Another Key in Vimium


I'm trying to remap the f key to another key on YouTube in Vimium because it conflicts with the full screen native shortcut. Ideally, it would only work for YouTube and/or other video player websites, but, at any rate, I'm trying to understand why adding something like:

map u f # or maybe `map f u`?

doesn't work globally. I've tried many other variations but nothing really worked. I think that the more proper way for this extension would be something like map f showShortcuts, but I don't know where to find a complete index for the correct showShortcuts types of commands.

So, does anyone know how to do this the correct way? Where can I find an exhaustive index of commands?


Solution

  • Maybe someone else has a better way of doing this, I don't know, but here it goes...

    1. The map function apparently doesn't accept key-key parameters, it is set to redirect to commands: map key command.
    2. Currently, there isn't a way of creating mappings for specific websites or patterns — see issue #3728.
    3. Besides scraping the code itself, I haven't found a summarized, exhaustive list of Vimium commands — they should be easily accessible through a table on the homepage of the documentation quite frankly. However, you can find a lot of them throughout the documentation, specially in the Tips and Tricks and the Key Mappings wiki pages..

    So, following specially the last point, we get to your answer:

    map u LinkHints.activateMode
    map U LinkHints.activateModeToOpenInNewTab