forked from tmsanrinsha/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
205 lines (175 loc) · 6.3 KB
/
.tmux.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# 基本設定 {{{
# ==============================================================================
# 以下のように省略できる
# set-option => set
# set-window-option => setw
# 既定のPrefixキー(Ctrl+b)の割り当てを解除
unbind-key C-b
# Ctrl+qをPrefixキーにする
set-option -g prefix C-q
bind-key C-q send-prefix
# 設定リロード
bind r source-file ~/.tmux.conf \; display-message "tmux RELOADED!!"
# screen で言うところの scrollback
set-option -g history-limit 50000
set-option -g buffer-limit 20
# ステータスライン更新間隔(秒)
# set -g status-interval 5
# set -g status-left-length 100
# set -g status-right-length 50
# 端末のタイトル
set -g set-titles on
set -g set-titles-string "tmux.#I.#W"
set -g visual-content on
set -g visual-activity on
set-window-option -g monitor-activity on
#set -g visual-silence on
#set-window-option -g monitor-silence 1
#メッセージの表示時間
set-option -g display-time 1000
# Escを打ったあとの待ち時間
# http://d.hatena.ne.jp/tacahiroy/20111206/1323123603
set -s escape-time 10
# ウィンドウ等の番号基準値
set-option -g base-index 1
set-window-option -g utf8 on
#}}}
# color {{{
# ==============================================================================
# 256色
# tmuxで256色にならないときはtmux -2と打ってみる
set-option -g default-terminal xterm-256color
# ステータスラインカスタム関連
set -g status-bg colour235
set -g status-fg white
#set -g status-attr dim
# 左部:whoami@hostname
#set -g status-left '#[fg=green,bold][#20(whoami)@#H]#[default]'
# 右部:[2011/03/06(Sun)20:21]
#set -g status-right '#[fg=white,bold][%Y/%m/%d(%a)%H:%M]#[default]'
set -g status-right '#[fg=white][%Y/%m/%d(%a)%H:%M]#[default]'
set -g status-right-bg black #colour235
#set -g message-attr bold
#set -g message-fg white
#set -g message-bg red
set -g pane-active-border-fg green
set -g pane-active-border-bg black
set-window-option -g window-status-bg black
set-window-option -g window-status-fg white
set-window-option -g window-status-current-bg colour27
set-window-option -g window-status-current-fg white
set-window-option -g window-status-current-attr bold
#set-window-option -g mode-bg white
#set-window-option -g mode-fg black
#}}}
# session {{{
# ==============================================================================
bind C command-prompt "new-session -s '%%'"
bind Space choose-session
bind Q switch-client -l # last-sessionに移動
#}}}
# window {{{
# ==============================================================================
# 新ウィンドウ作成
bind c new-window
# ウィンドウ終了
bind K kill-window
# 直前のウィンドウ
bind C-q last-window
#}}}
# pain {{{
# ==============================================================================
# ウィンドウの縦分割
bind s split-window -v
# ウィンドウの横分割
bind v split-window -h
# ペイン間の移動
bind k select-pane -U
bind C-k select-pane -U
bind j select-pane -D
bind C-j select-pane -D
bind h select-pane -L
bind C-h select-pane -L
bind l select-pane -R
bind C-l select-pane -R
# ペインの移動
# last-windowのlast-paneと現在のpaneの交換
bind ^ swap-pane -s :!
# join-pane
# http://d.hatena.ne.jp/kozo2/20111202/1322827858
# アクティブペインを前回のアクティブウィンドウに移動する
bind > join-pane -t:!
# 前回のアクティブペインをアクティブウィンドウに引っ張ってくる
bind < join-pane -s:!
# http://d.hatena.ne.jp/kozo2/?of=-17
#bind-key C-n swap-window -t:+ \; swap-pane -s:-
#bind-key C-p swap-window -t:- \; swap-pane -s:+
# アクティブなペインを新しいウィンドウに分割する
bind b break-pane
# ペインリサイズ
bind -r Left resize-pane -L 5
bind -r Right resize-pane -R 5
bind -r Down resize-pane -D 5
bind -r Up resize-pane -U 5
bind -r M-h resize-pane -L 40
bind -r M-l resize-pane -R 40
bind -r M-j resize-pane -D 10
bind -r M-k resize-pane -U 10
# ペイン番号表示
bind M-l display-panes
# ペインの同期のトグル
bind-key S set-window-option synchronize-panes
#}}}
# copy mode {{{
# ==============================================================================
# コピーモード突入
#bind y copy-mode
# ペースト
#bind p paste-buffer
# コピーモードでのカーソル移動を vi 風にする
set-window-option -g mode-key vi
bind -t vi-copy v begin-selection
bind -t vi-copy C-v rectangle-toggle
# できない
# bind -t vi-copy C-v rectangle-toggle \; send-keys v
bind -t vi-copy y copy-selection
# シェルのプロンプトをさかのぼる
bind @ copy-mode \; send-keys ? C-u tmiwa@ C-m
#}}}
# command prompt {{{
# =============================================================================
set-window-option -g status-keys emacs
# }}}
# mouse {{{
# ==============================================================================
# マウスドラッグでコピーモード
set -g mode-mouse on
# マウスクリックでペイン選択
set -g mouse-select-pane on
# マウスクリックでwindow選択
set -g mouse-select-window on
# マウスでペインの大きさの変更
set -g mouse-resize-pane on
#}}}
# 特殊なキーバインドの設定 {{{
# ==============================================================================
set-window-option -g xterm-keys on # to make ctrl-arrow, etc. work
# http://sanrinsha.lolipop.jp/blog/2012/07/%E3%82%BF%E3%83%BC%E3%83%9F%E3%83%8A%E3%83%AB%E3%81%A7ctrltab%E3%81%A8%E3%81%8B%E3%82%92%E4%BD%BF%E3%81%86.html
# Ctrl+Tab, Shift+Ctrl+Tabでウィンドウの切り替え
# Ctrl+数値でそのウィンドウ番号に切り替え
set -g terminal-overrides "*:kf13=[27;5;9~:kf14=[27;6;9~:kf15=[27;5;49~:kf16=[27;5;50~:kf17=[27;5;51~:kf18=[27;5;52~:kf19=[27;5;53~:kf20=[27;5;54~"
# prefix :server-infoで確認
bind -n F13 next
bind -n F14 prev
bind -n F15 select-window -t 1
bind -n F16 select-window -t 2
bind -n F17 select-window -t 3
bind -n F18 select-window -t 4
bind -n F19 select-window -t 5
#bind -n F20 select-window -t 6
# F21以降は認識されなかった
# 上でterminal-overfidesしたら、コピーモードでコピーした後、クリップボードに保存されなかったため
# 以下が必要
# http://doda.b.sourceforge.jp/2011/12/15/tmux-set-clipboard/
set -ag terminal-overrides "*:Ms=\\E]52;%p1%s;%p2%s\\7"
#}}}