1

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?

Philippe Fanaro
  • 6,148
  • 6
  • 38
  • 76

3 Answers3

2

I am a bit late to the game, but maybe this helps someone.
To be complete, I used openAI the help me get this done.
I remapped the F to CTRL + F

  1. Click the Vimium icon in the top-right corner of your Chrome browser. If you don't see the icon, click the puzzle piece icon (Extensions) and find Vimium in the list.
  2. Click on "Options" to open Vimium's settings page.
  3. In Vimium's settings, scroll down to the "Key Mappings" section.
  4. In the "Custom key mappings" text box add this: This unmaps the default F, and adds a CTRL + F mapping.
unmap f
map <c-f> LinkHints.activateMode
  1. Scroll down to the bottom of the page and click the "Save Changes" button.
Tyler2P
  • 2,324
  • 26
  • 22
  • 31
1

I use vimium-c and managed to solve the problem by reading the

Map a key for different command...

So this is how I have it for youtube Open the vimium-c options Shift + / it will open the key bindings and there you click options.

1st Add to Excluded URLs and keys

Pattern https://www.youtube.com/ Keys j k l

2nd Add to Custom key mappings

env youTube host="https://www.youtube.com/*"
map q runKey expect={"youTube":"scrollDown"} keys="q"
map e runKey expect={"youTube":"scrollUp"} keys="e"

With these settings you will have

For youtube j 10sec before k play/pause l 10ces later

For vimium-c q scrollDown e scrollUp

Now you can change q or e to some other keys if you wish. These are the ones that I found free (not used by youtube or vimium-c).

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Goku San
  • 71
  • 5
0

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
Philippe Fanaro
  • 6,148
  • 6
  • 38
  • 76