tmux cheat sheet
tmux cheat sheet and other settings.
general
- C+q is the prefix key (default: C+b)
- recommanded (in .tmux.conf):
set -g default-command "reattach-to-user-namespace -l $SHELL"
unbind -t emacs-copy M-w
bind-key -t emacs-copy M-w copy-pipe "reattach-to-user-namespace pbcopy"
c
toctrl
,m
tometa
- iterm2 > profile > keys > option key acts as
+Esc
- default (emacs style key bindings)
command line
$ tmux attach -t target
$ tmux new-session -s name
$ tmux list-sessions / tmux ls
$ tmux kill-session -t target
pane
o
switch pane orderly"
/%
split panec+arrow
/m+arrow
resize pane slowly / quicklyc+o
rotate panes /{
/}
swap this pane with the previous / next onex
kill pane
session
$
rename sessionS
switch to another session(
/)
cycle through sessionsr
refresh this clientd
/D
detach yourself / someone from session
window
c
create window0...9
choose windown
/p
next / previous windoww
list windowsl
switch to last window&
kill window,
rename window
misc
:
enter command?
list key bindingst
show clocki
display information
copy mode
[
enter copy mode]
paste (with in tmux)c+space
/shift + ctrl + 2
start selectionm+w
copy- press
esc
twice to exitcopy mode
search in copy mode
[
enter copy modec+s
search down /c+r
search in the reverse direction
others
use vi mode and other customize key bindings (in .tmux.conf)
ps: your life won't be easy with these settings, until you copy them to every machine you have.
setw -g mode-keys vi
set-window-option -g mode-keys vi
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# vim style pane movement
bind C-h select-pane -L
bind C-j select-pane -D
bind C-k select-pane -U
bind C-l select-pane -R
# pane re-sizing
bind -r H resize-pane -L 20
bind -r J resize-pane -D 20
bind -r K resize-pane -U 20
unbind L
bind -r L resize-pane -R 20
# split pane
unbind C-s
unbind C-v
bind C-v split-window -h
bind C-s split-window -v
unbind l
bind C-p previous-window
bind C-n next-window
unbind-key C-r
bind R source-file '/path/to/home/.tmux.conf'
# plugins
set -g @plugin 'tmux-plugins/tmux-sidebar'
run '~/.tmux/plugins/tpm/tpm'