-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
169 lines (153 loc) · 6.43 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
# キーストロークのディレイを減らす
set -sg escape-time 1
# ウィンドウのインデックスを1から始める
set -g base-index 1
# ペインのインデックスを1から始める
setw -g pane-base-index 1
# 設定ファイルをリロードする
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# C-z*2でtmux内のプログラムにC-zを送る
bind C-z send-prefix
# C-bのバインドを解除(一文字消さずに戻る)
unbind C-b
# Tmux prefix set as C-z
set -g prefix C-z
# | でペインを縦に分割する
bind | split-window -h
# - でペインを横に分割する
bind - split-window -v
# Vimのキーバインドでペインを移動する
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# Vimのキーバインドでペインをリサイズする
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# マウス操作を有効にする
setw -g mouse
# ステータスバーの色を設定する
set -g status-fg white
set -g status-bg black
# ウィンドウリストの色を設定する
setw -g window-status-fg cyan
setw -g window-status-bg default
setw -g window-status-attr dim
# アクティブなウィンドウを目立たせる
setw -g window-status-current-fg white
setw -g window-status-current-bg red
setw -g window-status-current-attr bright
# ペインボーダーの色を設定する
set -g pane-border-fg green
set -g pane-border-bg black
# アクティブなペインを目立たせる
set -g pane-active-border-fg white
set -g pane-active-border-bg yellow
# コマンドラインの色を設定する
set -g message-fg white
set -g message-bg black
set -g message-attr bright
# ステータスバーを設定する
## 左パネルを設定する
set -g status-left-length 80
set -g status-left "#[fg=green]Session: #S #[fg=yellow]Window: #I #[fg=cyan]Pane: #P"
## 右パネルを設定する
set -g status-right-length 80
set -g status-right "#[fg=cyan][%Y-%m-%d(%a) %H:%M]"
## ステータスバーのUTF-8サポートを有効にする
# set -g status-utf8 on
## リフレッシュの間隔を設定する(デフォルト 15秒)
set -g status-interval 60
## ウィンドウリストの位置を中心寄せにする
set -g status-justify centre
set-window-option -g window-status-format "#I: #W"
## ヴィジュアルノーティフィケーションを有効にする
setw -g monitor-activity on
set -g visual-activity on
## ステータスバーを上部に表示する
set -g status-position top
## commandline history settings
set-option -g history-limit 1000000
# コピーモードを設定する
## viのキーバインドを使用する
setw -g mode-keys vi
## クリップボード共有を有効にする
# sync clipboard
# for linux
if "which xclip" "bind-key -T emacs-copy C-w send-keys -X copy-pipe 'xclip -i -selection clipboard'";
if "which xclip" "bind-key ] run 'tmux set-buffer -- \"$(xclip -o -selection clipboard)\"; tmux paste-buffer'";
# # for mac
if "which pbcopy" "bind-key -T emacs-copy C-w send-keys -X copy-pipe 'pbcopy'"
if "which pbpaste" "bind-key ] run 'tmux set-buffer -- \"$(pbpaste)\"; tmux paste-buffer'"
# set-option -g default-command "reattach-to-user-namespace -l zsh"
## スクロールを有効化する(Mac込み)
## if you use iTerm, plz check profiles to turn on Save lines to scrollback when an app status bar is present and Enable xterm mouse reporting.
set-option -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
# 256色端末を使用する
set-option -g default-terminal screen-256color
set -g terminal-overrides 'xterm:colors=256'
# 親端末のTERMがxtermの場合
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# if the console size changed, aggressively change window size.
set -g aggressive-resize on
# Copy mode Keybindings.
# コピーモードを設定する
## コピーモードの操作をvi風に設定する
bind-key -T copy-mode-vi v send-keys -X begin-selection
### コピーモード中 C-v で矩形選択開始
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
### 1行選択
bind-key -T copy-mode-vi V send-keys -X select-line
bind-key -T copy-mode-vi y send-keys copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
### 1行コピー
bind-key -T copy-mode-vi Y send-keys copy-line
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
### Esc キーでコピーの反転を解除(コピーモードは抜けない)
bind-key -T copy-mode-vi Escape send-keys -X clear-selection
### Ctrl-c キーでコピーの反転を解除し、コピーモードから抜ける
bind-key -T copy-mode-vi C-c send-keys -X cancel
### Vi モード中に Ctrl-a で行頭に(Emacs ライク)
bind-key -T copy-mode-vi C-a send-keys -X start-of-line
### Vi モード中に Ctrl-e で行末に(Emacs ライク)
bind-key -T copy-mode-vi C-e send-keys -X end-of-line
### 単語の最初の1文字に移動
bind-key -T copy-mode-vi w send-keys -X next-word
### 単語の最後の1文字に移動
bind-key -T copy-mode-vi e send-keys -X next-word-end
### w の逆の動き back
bind-key -T copy-mode-vi b send-keys -X previous-word
### 画面上に映る最上行に移動
bind-key -T copy-mode-vi g send-keys -X top-line
### 画面上に映る最下行に移動
bind-key -T copy-mode-vi G send-keys -X bottom-line
### 前方検索
bind-key -T copy-mode-vi / send-keys -X search-forward
### 後方検索
bind-key -T copy-mode-vi ? send-keys -X search-backward
### ページスクロール
bind-key -T copy-mode-vi C-n send-keys -X page-up
bind-key -T copy-mode-vi C-f send-keys -X page-down
### ページ送り
bind-key -T copy-mode-vi C-u send-keys -X page-up
bind-key -T copy-mode-vi C-d send-keys -X page-down
#############
# Tmux Plugin Manager.
#############
# Press prefix + I (capital I, as in Install) to fetch the plugin.
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-online-status'
set -g @plugin 'tmux-plugins/tmux-battery'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'