If you’re a Mac user, you know how to use vim-style keyboard shortcuts to move around in your OS X screen. But what if you want to use these same shortcuts on a Windows computer? Well, there’s no need to worry! You can easily adapt the vim-style keyboard shortcuts for Windows by using the Windows Keyboard Shortcuts tool. This tool allows you to create custom shortcut keys for your keyboard, and it also includes a variety of other useful features. To use the Windows Keyboard Shortcuts tool, open it from the Start Menu or from the All Programs menu. Then, click on the New button on the left side of the main window. In this window, you’ll be able to select a type of shortcut key. For example, if you want to create a shortcut key that moves your cursor up one screen at a time, you would select New Keyboard Shortcut (Windows). Once you’ve selected this type of shortcut key, click on OK. The new keyboard shortcut will be created and will be listed in the list on the right side of the main window. You can also use this tool to create custom keys for specific tasks or windows in your OS X screen. For example, if you want to create a shortcut key that moves your cursor down one screen at a time, you would select New Keyboard Shortcut (Windows). Once you’ve selected this type of shortcut key, click on OK. The new keyboard shortcut will be created and will be listed in the list on the right side of the main window.
After switching to OS X when I got a new MacBook Air, one of the first things I needed to duplicate was my extremely customized AutoHotkey setup — the most important of which is using the J and K keys to navigate throughout tabbed windows easily. Yeah, I’m a Vim user.
I’ve never been a fan of having to use CTRL + TAB to switch from one tab to the next — to start with, you have to move your hands from the home row, and it’s awkward, and why should I have to do that just because somebody decided that keyboard shortcut before tabs became popular? If you think about it, if tabbed browsers were popular back when keyboard shortcuts were being invented, they would have definitely reserved some of the good shortcuts for switching tabs.
On Windows, I’ve always used an AutoHotkey script to make things the way I wanted them: ALT + J and ALT + K for selecting previous and next tabs. Once you get used to it, it’s extremely awesome, and so much faster than using CTRL + TAB. Of course, I also hacked CTRL + T and CTRL + W into ALT + T and ALT + W so I could open new tabs and close them without moving my hands from the home row.
Over on OS X, it turns out that it’s incredibly simple and easy to use CMD + J and CMD + K for next/previous tab navigation, and it works in most applications that support tabs, like Terminal, Safari, or Google Chrome.
And yes… I realize that in Vim you would be using H and L for moving left and right. The problem is that in OS X you can’t really use CMD + H since it’s an integral part of the operating system, so if you remap it, you’ll be missing out on another great feature. So using J and K works better.
Just open up System Preferences and head to Keyboard.
Select the Keyboard Shortcuts section and then Application Shortcuts. Create a new shortcut key, leave it set to All Applications, and type Select Next Tab into the box, giving it the keyboard shortcut of CMD + K. Repeat with Select Previous Tab and CMD + J.
When finished, it should look like this:
All you have to do is open up an application that supports tabs, and get used to a much faster navigation system.