Vimium: Control and Alt keys not working for Vimium Chrome on MacOS

Created on 8 Jul 2020  ·  16Comments  ·  Source: philc/vimium

Describe the bug
Control and Alt keys not working for Vimium Chrome on MacOS.

To Reproduce
c-f is supposed to go down a page.
a-f is supposed to open multiple links in new tabs
When I try command + f, I get the browser search. Im not sure how to use alt.

Browser and Vimium version
Vimium: Version 1.66
Brave 1.8.96 (though same with chrome)

Most helpful comment

@datavistics +100

Vimium is a productivity extension which means sparing time. It is a fantastic extension and the creator(s?), maintainer(s?) is (are?) doing a fantastic job! But the documentation could be easily and greatly improved especially to cover these very specific kind of cases.

This is not the first time I spend a significant amount of time to find the solution to a "bug" like this one: changed the mapping of one key of my Vimium settings for the 50th time and nothing happened. Tried new mappings with other Alt-key combinations. Same result. Went to Vimium wiki. Found nothing. Searched this repository. Finally found the solution.

If I were proficient enough in git, I would definitely create some some PRs.

To go back to the issue. Ctrl- keys combinations I've tested were working for me. None of the Alt- keys combinations I have tested were working.

Mac OS X 10.12.6
Vimium 1.66
Brave Browser v84.1.11.104

All 16 comments

For linkhints mode, you need to press and hold on Ctrl, and then press a letter key to activate it.

I wasn't able to get this to work, either alt-f, command-f, or holding down ctrl.

press a single f to open linkhints mode, and then press down and hold on ctrl and press some hint characters, to open a link in the new tab.

@gdh1995 , I think you are answering a different question. I know how to follow a link.

Can you tell me on a mac using Vimium how to scroll down a page? According to the documentation its Cmd-f. But Cmd-f opens the browser find.

Why do you think it's a meta-f? The default key of scrollding down is a single J

By the way, c-f means to press control and f, And m-f means meta(command) and f, while a-f is only for windows and linux - There is no alt key on a macOS keyboard layout.

Let me start over, I think we got lost somewhere.

According to this site:
c-f | Scroll a full page down
c-b | Scroll a full page up
I know about j and d to scroll down and scroll a half page down respectively.
Id like to know how to scroll a full page down.
Its possible that these are dated as they are from the github.io site.

Id also like to know how to
<a-p> pin/unpin current tab
<a-f> open multiple links in a new tab
Which are taken from the README.

Im on a Mac, so I dont have an Alt key. Ive tried Shift, Option, Control, and Command with no luck.

Um the page is too old - according to https://github.com/philc/vimium/blob/master/CHANGELOG.md, <c-f> has been removed from the default binding list since v1.26 (2011-02-17).

You may map other keys to pin/unpin current tab. For example, <m-p> means Meta + P, and P means Shift + P

Ok, good to know about the c-f.

I can remap easy enough, and that is a good solution for me.

Id like to know what the intended behavior is for Macs though. There should be a disclaimer saying windows only, or maybe there is a bug in some of the modifier keys for macs.

There're only 3 default key bindings using Alt: a-f LinkHints.activateModeWithQueue, a-p togglePinTab, a-m toggleMuteTab , and usually users will remap keys when they want to use some other commands.

Vimium should work well on Mac, because its main developers seem to have macOS for daily use. If a composed key can not be grabbed by Vimium, the most common reason is that it's a high-priority shortcut of Chrome and can not be overridden by JavaScript.

Just backing up @datavistics: I just got this extension yesterday and have had no luck with a-f. I'm on Mac. Similarly I have tried command, option, control, shift, fn, and combinations of the above.

@datavistics @isaiahtaylorhh Have you enabled the Ignore keyboard layout in Advanced Options?

https://github.com/philc/vimium/issues/3197#issuecomment-614829140

Vimium is unable to detect mappings using Option (Alt) key as modifier on macOS unless "Ignore keyboard layout" setting is checked. Otherwise it uses KeyboardEvent.key to identify the key press which means e.g. <a-p> is identified as letter π on macOS since Option key is used to type additional characters. See relevant code:

https://github.com/philc/vimium/blob/ac5f9d3407bcf07c50a0119aede916fdd561f224/lib/keyboard_utils.js#L22-L23

This should be documented on somewhere if it is not.
I think the best place is the note section of the Ignore keyboard layout option.

FWIW, I noticed that option key binding works well without enabling the Ignore keyboard layout option on macOS firefox
which contradicts https://github.com/philc/vimium/issues/3197#issuecomment-614829140

@templateK
That worked! This should be broadcasted more visibly. I looked for quite a while and didnt find anything.
Can we put this in the readme for mac users?

@datavistics +100

Vimium is a productivity extension which means sparing time. It is a fantastic extension and the creator(s?), maintainer(s?) is (are?) doing a fantastic job! But the documentation could be easily and greatly improved especially to cover these very specific kind of cases.

This is not the first time I spend a significant amount of time to find the solution to a "bug" like this one: changed the mapping of one key of my Vimium settings for the 50th time and nothing happened. Tried new mappings with other Alt-key combinations. Same result. Went to Vimium wiki. Found nothing. Searched this repository. Finally found the solution.

If I were proficient enough in git, I would definitely create some some PRs.

To go back to the issue. Ctrl- keys combinations I've tested were working for me. None of the Alt- keys combinations I have tested were working.

Mac OS X 10.12.6
Vimium 1.66
Brave Browser v84.1.11.104

I've experienced the same issue in my Mac-FF because I have symbols/punctuation layer (AltGr) set in my Colemak layout as well as in Karabiner Elements. For example, the search (/) char is triggered/outputted by Alt-l in my customization which will not work because I couldn't enable this setting since I use Colemak layout: Ignore keyboard layout option.

I think Alt should be supported regardless of keyboard layout/customization since mine is working as intended in all apps including vim. It doesn't work only when using Vimium.

Was this page helpful?
0 / 5 - 0 ratings