Skip to Content

Vimium use Alt key for mapping on MacOS

Posted on

Vimium is one of my favorite extensions. It provides keyboard shortcuts for navigation and control in the spirit of Vim.

Vimium allows us to use some keybindings with Alt key. For example:

<a-f> open multiple links in a new tab
<a-p> pin/unpin current tab
...

Reference: https://github.com/philc/vimium/blob/master/README.md

However, I can’t use this feature on MacOS. When I type Alt + f (Option + f), nothing happen. ❓

After searching for a while, I found this comment on Vimium issues:

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. is identified as letter π on macOS since Option key is used to type additional characters.

So, to use Alt key on MacOS, there are 2 ways: Open Vimium settings

  1. Check to box “Ignore keyboard layout”
  2. Remap on custom key mappings to use additional characters:
map <a-ƒ> LinkHints.activateModeWithQueue
map <a-¬> closeTabsOnLeft
map <a--®> closeTabsOnRight
map <a-ø> closeOtherTabs

You could view my backup on Github for Vimium options, with Dracula dark theme for Vimium.

comments powered by Disqus