Cmd + PgUp/Down shortcut to navigate through terminal tabs

keybindingskeyboard

is it possible to make Cmd+Page Up / Page Down shortcut performing switch tab in Terminal?

At the moment I can use Cmd+Shift+[ or Cmd+Shift+] shortcuts to do the thing, but this is horrible for me. I'm using external USB Keyboard and Karabiner, if that may help somehow.

Best Answer

Update:
The answer now reassigns Scroll to Top/Bottom to ⌥⌘PageUp and ⌥⌘PageDown.
This leaves Show Previous/Next Tab free to take over ⌘PageUp and ⌘PageDown.


Assuming your OS X runs in English, you can use this one-liner:

defaults write com.apple.Terminal NSUserKeyEquivalents -dict-add 'Scroll to Top' '~@\Uf72c' 'Scroll to Bottom' '~@\Uf72d' 'Show Previous Tab' '@\Uf72c' 'Show Next Tab' '@\Uf72d'

If your OS X runs in a language other than English, modify the command to resemble the exact menu item text for your language.