iTerm2 keyboard shortcut - split pane navigation

114,028

Solution 1

From the documentation:

Cmd] and Cmd[ navigates among split panes in order of use.

Solution 2

Cmd+opt+/// navigate similarly to vim's C-w hjkl.

Solution 3

++/// will let you navigate split panes in the direction of the arrow, i.e. when using +D to split panes vertically, ++ and ++ will let you switch between the panes.

Solution 4

there is configuration in the following way:

Preferences -> keys -> Navigation shortcuts

the 3rd option: shortcut to choose a split pane is "no shortcut" by default, we can choose one

cheers

Solution 5

I was using Terminator before, so I found it convenient to re-map Alt + arrow-key to switch between the panes. This can be done in Preferences -> Keys -> Key Mappings - press the '+' button to add a mapping. Also, in my case such a mapping was already defined in Profiles, I simply removed it.

Share:
114,028
Calvin Cheng
Author by

Calvin Cheng

I design and code! And here's my stackoverflow careers page: http://careers.stackoverflow.com/cv/employer/87142

Updated on July 10, 2022

Comments

  • Calvin Cheng
    Calvin Cheng almost 2 years

    I have been a long time user of the standard Mac Terminal. Decided to experiment with iTerm2 after hearing good things about it from my colleagues.

    One of the more useful features I am seeing on iTerm2 is its split panes (much like vim split buffers).

    In vim, I can move between split buffers using Ctrl+W+arrowkeys. Is there a keyboard shortcut for iTerm2 to move between panes as well?

  • james_womack
    james_womack about 11 years
    I'm using those commands to strobe my screen to the dubstep track playing in the office.
  • Bombe
    Bombe over 10 years
    This does not work with a German keyboard… better use ⌘+⌥+← or ⌘+⌥+→, see my answer below.
  • RickyCheers
    RickyCheers about 10 years
    @Bombe you could also try ⌘+⌥+[ or ⌘+⌥+]. That worked for me on a spanish keyboard
  • Bombe
    Bombe about 10 years
    @RickyCheers nope, doesn’t work on German keyboards; [ and ] both require additional keys to be pressed.
  • Himz
    Himz almost 10 years
    This answer works best and is most intuitive!. Thanks
  • frhd
    frhd over 9 years
    Damn you apple, with the complete ass-backwards German key layout!
  • ManuelSchneid3r
    ManuelSchneid3r about 9 years
    Is it possible to change this hoteky to use opt only?
  • DigitalDesignDj
    DigitalDesignDj over 8 years
    I have changed my config a lot, but I had to set these keys up before they worked.
  • Bombe
    Bombe over 8 years
    @mrfred now if only iTerm was configurable… OH WAIT IT IS.
  • Joris
    Joris over 8 years
    For reference, if you want to remap this to e.g. Cmd-Up Arrow, Cmd-Down Arrow, Cmd-Left Arrow and Cmd-Right Arrow to nagivate accordingly between split panes, you can do this by remapping these respective keys to "Select Split Pane Above" and its Below, Left, Right companions in Preferences -> Profiles/<Your Profile>/Keys
  • Pijusn
    Pijusn over 7 years
    This used to work on my machine but after last OS X upgrade it stopped working as well as some other shell shortcuts (not part of iTerm). However, @Bombe 's answer with arrow keys still works and is even easier to use.
  • rexford
    rexford over 6 years
    I second mrfred
  • jenkizenki
    jenkizenki over 6 years
    This should be the best answer. This one actually helps
  • Sundar
    Sundar almost 6 years
    @ManuelSchneid3r you can add custom short cut keys in your iterm2 profile (Preferences -> Profiles/<Your Profile>/Keys). There you have actions "Select Split Pane Above", "Select Split Pane Below", "Above" "Down".
  • Cyril Duchon-Doris
    Cyril Duchon-Doris almost 6 years
    [ and ] are also impossible to use on the french layout, ⌘+⌥+arrow-keys wins
  • J. M. Habibi
    J. M. Habibi over 4 years
    This, in my opinion, should be the no. 1 answer because it allows you a few options on hotkeys. Those options are: - No Shortcut, - ⌥ + Number, - ⌘ + Number, - and ⌥ + ⌘ + Number. It should be noted that choosing ⌘ + Number will conflict with the default key combination for switching between tabs.
  • Alex Steinberg
    Alex Steinberg over 3 years
    In case anyone is interested +Shift+D splits panes horizontally.
  • Detached
    Detached over 2 years
    This answer works best and is most intuitive! Thanks