tmux cheat sheet
カスタム設定したものを含む
.tmux.conf
# utf-8 対応 set-window-option -g utf8 on # set prefix C-t set-option -g prefix C-t # split window key #bind v split-window -v #bind h split-window -h # change pane size # allow recursive input bind -r C-h resize-pane -L 3 bind -r C-j resize-pane -D 3 bind -r C-k resize-pane -U 3 bind -r C-l resize-pane -R 3 # jump pane bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R # jump pane w/o prefix bind -n S-left select-pane -L bind -n S-down select-pane -D bind -n S-up select-pane -U bind -n S-right select-pane -R # put status bar on the top of window set-option -g status-position top # vi binding set-window-option -g mode-keys vi # copy and paste bind-key > save-buffer ~/.tmux-buffer \; run-shell 'xsel -b -i < ~/.tmux-buffer' \; display-message "Copied to clipboard" bind-key < if-shell 'xsel -b -o > ~/.tmux-buffer' 'load-buffer ~/.tmux-buffer ; paste-buffer'
覚え中
$ tmux new[-session] -s SESSION_NAME
セッション名をSESSION_NAMEとした新しいセッションを開始
$ tmux a[ttach] -t SESSION_NAME
セッション名SESSION_NAMEへアタッチ
省略した場合は最新のセッション
$ tmux l[ist-]s[ession]
残っているセッション一覧
覚えた
■history/copy
bindkey [ : コピーモード開始
bindkey ] : paste the most recently copied buffer of text
q : コピーモード終了
SPC : Start selection
Enter : Copy selection
■ペーン分割
bindkey % : 縦分割(左右に)
bindkey " : 横分割(上下に)
bindkey [hjkl] : 分割したペーン間を←↓↑→に移動
bindkey C-[hjkl] : ペーンの区切りを←↓↑→に移動しペーンの広さを変更する
■ウィンドウ
bindkey c : 新しいウィンドウを作成
bindkey n/p : 次の/前のウィンドウへ移動
bindkey x : ウィンドウ・ペーンを閉じる
■その他
bindkey d : deactivate
bindkey t : 時計を表示