Tmux commands and shortcuts

Tmux commands and shortcuts

About

These commands work with my .tmux.conf file which can be found at https://gitlab.com/tuckerw/dotfiles/raw/arch/.tmux.conf

cd
wget https://gitlab.com/tuckerw/dotfiles/raw/arch/.tmux.conf # OR
curl -O https://gitlab.com/tuckerw/dotfiles/raw/arch/.tmux.conf

source the file from inside of tmux session:

<prefix>:source ~/.tmux.conf

(prefix will be ctrl-a or ctrl-b)

General

prefix

ctrl + a

start new

tmux

start new session with name

tmux new -s myname

attach

tmux -a

attach to named session

tmux -a -t myname

list sessions

tmux ls

kill session

tmux kill-session -t myname

The following must be prefixed with the prefix C-a

Sessions

s switch sessions (use j and k plus <CR> to switch sessions)

$ rename session

d detach user from session

Windows (tabs)

A rename window

c create window

w list windows

n next window

p previous window

f find window

, name window

& kill window

H L swap window with window to left or right

Moving windows: https://stackoverflow.com/questions/3094946/move-window-between-tmux-clients

Reordering windows: https://superuser.com/questions/343572/how-do-i-reorder-tmux-windows , https://unix.stackexchange.com/questions/151329/reorder-tmux-windows

:swapw -t 2 swap current window with spot 2

movew move window to next unused number

movew -t 3 move window to spot 3

movew -t other: move window to session ‘other’

movew -t other:3 move window to session ‘other’ window-spot 3

Panes (splits)

% vertical split

" horizontal split

z toggle zoom (i.e. full-screen)

h j k l move pane left, down, up, and right

ctrl + h j k l resize pane left, down, up, and right

! break pane into its own window

:join-pane -t :n join pane back into window n

:setw synchronize-panes toggle synchronizing panes! Super useful for running commands in multiple folders or on multiple servers at once

Commands

Misc

Copy Mode

Reload

Screenshot