-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
160 lines (118 loc) · 4.81 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
#########################################
# 画面周り
#########################################
# tmuxを256色表示できるようにする
set-option -g default-terminal 'screen-256color'
set -g terminal-overrides 'xterm:colors=256'
# ステータスバーをトップに配置する
set-option -g status-position top
# 下記の設定をしておいたほうがEscの効きがいいらしい
set -s escape-time 0
# ペインのボーダーの色
set -g pane-border-style fg=colour111
set -g pane-active-border-style "bg=default fg=colour111"
# ペインのインデックスを1から始める
setw -g pane-base-index 1
# 左右のステータスバーの長さを決定する
set-option -g status-left-length 90
set-option -g status-right-length 90
# #P => ペイン番号
# 最左に表示
set-option -g status-left ' Pane Num: #P'
# Wi-Fi、バッテリー残量、現在時刻
# 最右に表示
set-option -g status-right ' #(wifi) #(battery --tmux) #{battery_icon} %m-%d(%a) %H:%M'
# バッテリーの残量によって表示するアイコンを変更する
set -g @batt_icon_charge_tier8 '🌕'
set -g @batt_icon_charge_tier7 '🌖'
set -g @batt_icon_charge_tier6 '🌖'
set -g @batt_icon_charge_tier5 '🌗'
set -g @batt_icon_charge_tier4 '🌗'
set -g @batt_icon_charge_tier3 '🌘'
set -g @batt_icon_charge_tier2 '🌘'
set -g @batt_icon_charge_tier1 '🌑'
set -g @batt_icon_status_charged '🔋'
set -g @batt_icon_status_charging '⚡'
set -g @batt_icon_status_discharging '👎'
set -g @batt_color_status_primary_charged '#3daee9'
set -g @batt_color_status_primary_charging '#3daee9'
# ステータスバーを1秒毎に描画し直す
set-option -g status-interval 1
# センタライズ(主にウィンドウ番号など)
set-option -g status-justify centre
# ステータスバーの色を設定する ターミナルのテーマはsmoooooth
# github themeで使用(背景色と同化)
# set-option -g status-bg "#0a0c10"
# pabloで使用(背景色と同化)
# set-option -g status-bg "#14191e"
# draculaで使用(背景色と同化)
# set-option -g status-bg "#282a36"
# papercolorで使用(背景色と同化)
set-option -g status-bg "#1c1c1c"
# ステータスバーの文字色を指定する
set-option -g status-fg "colour45"
# アクティブなウィンドウを目立たせる
setw -g window-status-current-style "fg=colour242,bg=colour195"
# Undercurl
# MEMO: github-nvim-themeを使用するのに必要な設定
set -g default-terminal "${TERM}"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
#########################################
# キーバインド
#########################################
# prefixキーをControl + qに変更
set -g prefix C-q
# C-bのキーバインドを解除
unbind C-b
# vimのキーバインドでペインを移動する
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# 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
# | でペインを縦分割する
bind | split-window -h
# - でペインを縦分割する
bind - split-window -v
# コピーモードを設定する
# コピーモードでvimキーバインドを使う
setw -g mode-keys vi
# 'v' で選択を始める
bind -T copy-mode-vi v send -X begin-selection
# 'V' で行選択
bind -T copy-mode-vi V send -X select-line
# 'C-v' で矩形選択
bind -T copy-mode-vi C-v send -X rectangle-toggle
# 'y' でヤンク
bind -T copy-mode-vi y send -X copy-selection
# 'Y' で行ヤンク
bind -T copy-mode-vi Y send -X copy-line
# 'C-p'でペースト
bind-key C-p paste-buffer
# tmuxからクリップボードにコピー
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel -bi"
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xsel -bi"
# 設定ファイルをリロードする
# ctrl + q + r
bind r source-file ~/dotfiles/.tmux.conf \; display ".tmux.conf Reloaded!"
#########################################
# その他設定
#########################################
# ウィンドウ履歴の最大行数
set-option -g history-limit 20000
# 番号基準値を変更
set-option -g base-index 1
# マウス操作を有効にする
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'"
#########################################
# Tmux Plugin Manager
#########################################
set -g @plugin 'tmux-plugins/tmux-battery'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run-shell '~/.tmux/plugins/tpm/tpm'