ruk·si

🖥️ iTerm
⌨️ Keybindings

Updated at 2015-10-27 15:56

It's very frustrating to back and forth between terminal and your editor/IDE to find a missing keybinding breaking your flow. Here is my basic setup.

  1. Set ALT to work as an escape character.
    iTerm -> Preferences -> Profiles -> Keys -> Left Option acts as +Esc
    
  2. Add new keyboard shortcut from the same window.
    + ->
        Keyboard Shortcut:  ALT + LEFT
        Action:             Send Escape Sequence
        Esc+:               b
    + ->
        Keyboard Shortcut:  ALT + RIGHT
        Action:             Send Escape Sequence
        Esc+:               f
    + ->
        Keyboard Shortcut:  CMD + LEFT
        Action:             Send Escape Sequence
        Esc+:               [H
    + ->
        Keyboard Shortcut:  CMD + LEFT
        Action:             Send Escape Sequence
        Esc+:               [F
    + ->
        Keyboard Shortcut:  CMD + BACKSPACE
        Action:             Send Hex Code
        Hex Code:           0x15 (CTRL+U)
    
  3. ALT + BACKSPACE should already remove up to previous word.
  4. Go to Global Shortcut Keys through the header nav.
    1. Change CMD + UP to "Scroll One Page Up"
    2. Change CMD + DOWN to "Scroll One Page DOWN"

Extra tips:

How to select and copy text from iTerm without using your mouse:

  1. Press CTRL + F to start a search.
  2. Type the first part of the pattern what you want to select.
  3. Press ENTER to go to the previous upwards, SHIFT+ENTER to go downwards.
  4. Press TAB to expand selection to the right, or SHIFT+TAB to expand to the left.
  5. You can press Esc or CTRL + F to close the search.
  6. Copy the text with Cmd + C

How to find a command from your command history:

  1. Press CTRL + R
  2. Type part of the command to search.
  3. Press CTRL + R to cycle through all the matches.
  4. Press ENTER to execute.

Other important keybindings:

Cmd + D         = Split tab to 2 panes side by side.
Cmd + Shift + D = Split tab to 2 panes on top of each other.
Cmd + [         = Next pane
Cmd + ]         = Previous pane
Cmd + Alt + I   = Send next inputs to all panes AND tabs in the current window