I'm trying to simplify the way that I navigate between tabs in my terminal. Using ssh <workstation> -t 'tmux -CC attach', I can get iTerm to display tmux tabs as native macOS tabs (and therefore use the normal macOS keyboard shortcuts command-{ and command-} for tab navigation), and I'd like to go one step further and get vim tabs within tmux to be treated the same way.

Is there a way to make vim create tmux tabs, instead of its own native tab type?

Alternatively, is there a way to make tmux somehow know that when I hit command-{ or command-} in iTerm, that it should send a special key code to vim to make it switch tabs? (And ideally, is there any way to tell if I'm at the first or last tab in vim, so that I jump to the next tmux tab instead of wrapping to the next vim tab?)

(I've seen a way to integrate splits here, but if I understand right, that doesn't do anything related to tabs.)

  • Someone is overusing tabs. – romainl Apr 25 '18 at 12:45

The normal mode command gt, can also be obtained using the ex mode command :tn.

Similarly the normal mode command gT can also be obtained using the ex mode command :tp.

Ref: https://superuser.com/a/884981/658319

Next, you can map the Mac command key in iTerm2 using: https://stackoverflow.com/a/46018502/4752883

Let me know if you have any questions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.