Skip to content

Instantly share code, notes, and snippets.

@awkale
Last active February 4, 2019 16:57
Show Gist options
  • Save awkale/7a2b56582b71e4f5f8db726843ca5ad6 to your computer and use it in GitHub Desktop.
Save awkale/7a2b56582b71e4f5f8db726843ca5ad6 to your computer and use it in GitHub Desktop.
#TMUX #cheatsheet

Windows (tabs)

c create window

w list windows

n next window

p previous window

f find window

, name window

& kill window

Panes (splits)

% vertical split

" horizontal split

o swap panes

ctrl-o move panes

q show pane numbers

x kill pane

+ break pane into window (e.g. to select text by mouse to copy)

- restore pane from window

space - toggle between layouts

<prefix> q (Show pane numbers, when the numbers show up type the key to goto that pane)

<prefix> { (Move the current pane left)

<prefix> } (Move the current pane right)

<prefix> z toggle pane zoom

Resizing Panes

You can also resize panes if you don’t like the layout defaults. I personally rarely need to do this, though it’s handy to know how. Here is the basic syntax to resize panes:

PREFIX : resize-pane -D (Resizes the current pane down)

PREFIX : resize-pane -U (Resizes the current pane upward)

PREFIX : resize-pane -L (Resizes the current pane left)

PREFIX : resize-pane -R (Resizes the current pane right)

PREFIX : resize-pane -D 20 (Resizes the current pane down by 20 cells)

PREFIX : resize-pane -U 20 (Resizes the current pane upward by 20 cells)

PREFIX : resize-pane -L 20 (Resizes the current pane left by 20 cells)

PREFIX : resize-pane -R 20 (Resizes the current pane right by 20 cells)

PREFIX : resize-pane -t 2 20 (Resizes the pane with the id of 2 down by 20 cells)

PREFIX : resize-pane -t -L 20 (Resizes the pane with the id of 2 left by 20 cells)

Scrolling

<prefix> [ then you can use your normal navigation keys to scroll around. Press q to quit scroll mode. Alternatively you can press <prefix> PgUp to go directly into copy mode and scroll one page up.

Copying

<prefix> [ to enter copy mode

<prefix> w to copy region highlighted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment