System wide vim-like tab switching in Mac Os
Mac Os allows you to natively map any menu bar command to a keybind of your choice. We can use it to map switching between tabs to ergonomic vim-like cmd+j/k instead of ctrl+tab/ctrl+shift+tab system-wide.
Start by locating tab switching commands in the menu bar:
The mapping works by matching the exact command’s name, so you need to note them carefully.
For switching tabs, in my experience, every application uses the “Select Next/Previous Tab” command, except for Chrome, which uses “Select next/previous tab” (i.e., lowercase), and Safari, which uses “Show Next/Previous Tab” ¯ \_(ツ)_/¯
Next, go to the System Preferences > Keyboard > Shortcuts > App Shortcuts, click on the plus sign, and enter the name of the command which you noted previously:
After adding all the keybinds, you will end up with something like that:
From now on, you should be able to use a way more ergonomic cmd+j/k to switch between tabs in most applications - and if a particular application uses a different system in place of the tabs, you know how to map it to the same keybind so that you can make better use of your muscle memory.
Tweet