{
"$type": "site.standard.document",
"description": "I use MacVim as my primary editor and since it uses hjkl as arrow keys and have gotten used to h and l representing left and right respectively. I",
"path": "/navigation-tabs-with-keyboard-for-macvim-other-apps-on-os-x/",
"publishedAt": "2015-06-07T06:42:00.000Z",
"site": "at://did:plc:bryys25pc2fnagnyxqgsglhd/site.standard.publication/3mn26bjkkmh23",
"tags": [
"vim",
"Tools"
],
"textContent": "I use MacVim as my primary editor and since it uses hjkl as arrow keys and have gotten used to h and l representing left and right respectively. I prefer to use the keyboard over the trackpad (or mouse) wherever possible, so I wanted to replicate using these keys as closely as possible for working tabs.\n\nMacVim has tabs, so what better than to start with that? In .vimrc, I map Ctrl-h and Ctrl-l to gT and gt respectively:\n\n:map <c-h> <Esc>gT\n:map <c-l> <Esc>gt\n\nOS X allows you to configure and override keyboard shortcuts for menu items for any app. In System Preferences.app > Keyboard > Shortcuts. Under All Applications, I add shortcuts for Select Previous Tab, Previous Tab and Show Previous Tab, assigning them all to Ctrl-H. I add Ctrl-L for Show Next Tab, Next Tab and Select Next Tab. These shortcuts cover as least Safari, Chrome, Finder, HipChat, Terminal (and iTerm).\n\nI also add app-specific shortcuts — Select Previous Conversation and Select Next Conversation for Messages.app, Previous Chat and Next Chat for Adium.app.\n\nWith this setup, I can use h-l as left and right when I'm editing a file in MacVim, use Ctrl-h and Ctrl-l to switch tabs both in MacVim and in most other OS X apps.",
"title": "Navigating Tabs With The Keyboard for MacVim and Other Apps on OS X"
}