Macos – Switching tabs in Mac terminal with Ctrl+PageUp/PageDown

keyboard shortcutsmacosterminal

I've recently started using a Mac (running Lion), and there is one inconsistency that's getting to me.

In Chrome and MVim, I can switch tabs with Ctrl+PageUp/PageDown. But, in the Terminal, I have to use Cmd+Shift+Left/Right.

I'd like to change the latter to Ctrl+PageUp/PageDown, but I can't seem to do this.

When I go into System Preferences → Keyboard → Keyboard Shortcuts → Application Shortcuts, and add a shortcut to Terminal's "Select Next Tab", I can set it to be pretty much anything as long as it does not include a PageUp/PageDown key.

Why is there such a limitation, and can I get around it?

Best Answer

defaults write -g NSUserKeyEquivalents -dict-add "Select Previous Tab" "^\UF72C" "Previous Tab" "^\UF72C" "Previous Workspace" "^\UF72C" "Select Next Tab" "^\UF72D" "Next Tab" "^\UF72D" "Next Workspace" "^\UF72D"

-g modifies ~/Library/Preferences/.GlobalPreferences.plist. You need to reopen apps to apply changes, and the manually added shortcuts aren't displayed in Application Shortcuts.

Related Question