Skip to content

Latest commit

 

History

History
108 lines (74 loc) · 1.44 KB

File metadata and controls

108 lines (74 loc) · 1.44 KB

Tmux

Sessions

creating new session

tmux new -s <my-session>

list sessions

tmux ls

attach exist session

tmux a -t <my-session>

deattach session

CTRL + b + d

kill session

tmux kill-session -a -t mysession

kill all sessions

tmux kill-server

Window

create new window

CTRL + b + c

next window

CTRL + b + n

specific window

CTRL + b + 0..9

Rename window

CTRL + b + ,

Reorder window, swap window number 2(src) and 1(dst)

:swap-window -s 2 -t 1

Move current window to the left by one position

:swap-window -t -1

Pane

Split pane vertically

CTRL + b + %

Split pane horizontally

CTRL + b + "

Close pane horizontally

CTRL + b + X


Fix tmux zsh-highlighting issue for mac

tmux default TERM is screen:

$ env | grep TERM
TERM=screen

You can solve it like this:

echo  "export TERM=xterm-256color" >> ~/.zshrc
exec zsh

Tmux config

set-window-option -g mode-keys vi
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'

# vim-like pane switching
bind -r ^ last-window
bind -r k select-pane -U
bind -r j select-pane -D
bind -r h select-pane -L
bind -r l select-pane -R

#bash #tmux