.tmux.confをごにょごにょする

tmuxの設定をいじってたらこんな感じに
http://gyazo.com/85ceaef3441c30038fa1f1303946a8f6.png

昨日はInconsolata使いたくてiTerm使ってみたが、重すぎて諦めた。今はデフォルトのTerminalにTakaoフォントを使っている。
Macのターミナルも日本語フォントと英フォントを分離できたらいいんだけどなぁ 混ぜ物を作るのも面倒だ

.tmux.conf

基本はMANで読んで、ソースコード検索で引っかかったページからコピペコピペ

# Prefix
set-option -g prefix C-t

# View
set -g status-interval 5
set -g status-left-length 16
set -g status-right-length 50

set -g status-bg black
set -g status-fg white
set -g status-left '#[fg=cyan,bold][#14H:#S]#[default]]'
set -g status-right '|#[fg=magenta,bold]#(load.sh)#[default]| #[fg=blue,bold][%a %m/%d %H:%M]#[default]'
set -g message-attr bold
set -g message-fg white
set -g message-bg red

set  -g pane-active-border-fg cyan
set  -g pane-active-border-bg black
setw -g window-status-current-fg blue

set-window-option -g mode-bg white
set-window-option -g mode-fg black
set-window-option -g window-status-fg white
set-window-option -g window-status-bg black
set-window-option -g window-status-current-attr underline
set-window-option -g window-status-current-bg black
set-window-option -g window-status-current-fg green

# Option
set-window-option -g utf8 on
set-window-option -g mode-keys vi
set-window-option -g automatic-rename off
set-option -g mouse-select-pane on
set-option -g base-index 1

# KeyBindings
unbind l
unbind ^C

bind C-r source-file ~/.tmux.conf
bind C-t next-window
bind c  new-window
bind 1 break-pane
bind 2 split-window -v
bind 3 split-window -h

bind -r C-h resize-pane -L 6 
bind -r C-l resize-pane -R 6
bind -r C-j resize-pane -D 6
bind -r C-k resize-pane -U 6
bind -r s swap-pane -U

bind k kill-pane
bind K kill-window
bind i display-panes
bind y copy-mode
bind p paste-buffer

prefix 1.2.3 でEmacs風に画面分割する。prefix C-(h.j.k.l) で分割ペインを伸張する。
prefix C-r で .tmux.confファイルのリロード。

多段にする際は ローカルとリモートでPrefixキーを異なるものにしておく。自分はローカルは C-t で、リモートは C-q 。ここらへんは趣味なので適当に。*1

$ tmux set-option -g prefix C-t

で一時的にprefixを変更できる。というかどのコマンドも基本的にこうやって発行できる。


confファイルを手動で読み込ませたかったら

$ tmux -f ~/.tmux.conf

参考

細かいTIPSはMANPAGE直接読むのが早い
Manpage of TMUX


ソースコード検索で他人の設定パクる
tmux.conf - Google Code Search


TIPSとして 試験運用中なLinux備忘録 様から
tmux - Google 検索

*1:C-q潰すなんてとんでもない!と思ってる人多そう