-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
158 lines (111 loc) · 5.95 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
# tmux起動時のシェルをzshにする
set-option -g default-shell /bin/zsh
# prefixキーをC-jに変更する
set -g prefix C-j
# ウィンドウ終了
bind Q kill-window
## --------------------見た目--------------------
# tmuxを256色表示出来るようにする
set-option -g default-terminal screen-256color
set -g terminal-overrides 'xterm:colors=256'
# 非アクティブなウィンドウの背景色を灰色にする
set-option -g window-style 'bg=#444444'
# アクティブなウィンドウの背景色を黒色にする
set-option -g window-active-style 'bg=#222222'
# status-left の最大の長さを指定する。
set-option -g status-left-length 20
# status-left のフォーマットを指定する。
set-option -g status-left "#[fg=colour255,bg=colour241]Session: #S #[default]"
# window-status のフォーマットを指定する。
set-window-option -g window-status-format " #I: #W "
# カレントウィンドウの window-status のフォーマットを指定する
set-window-option -g window-status-current-format "#[fg=colour255,bg=colour27,bold] #I: #W #[default]"
# 現在時刻を最右に表示
set-option -g status-right '%Y-%m-%d(%a) %H:%M:%S'
# ステータスバーを1秒毎に描画し直す
set-option -g status-interval 1
# ウィンドウ名を、zshのときだけカレントディレクトリ名にする
# https://qiita.com/frnfnts/items/e9e55448e66d5b2df340
set -g automatic-rename on
set -g window-status-format '#I:#{?#{m:#W,zsh},#(basename #{pane_current_path}),#W}#F'
set -g window-status-current-format '#I:#{?#{m:#W,zsh},#(basename #{pane_current_path}),#W}#F'
## --------------------マウス--------------------
#マウス操作を有効にする
set-option -g mouse on
# スクロールアップするとコピーモードに入る
bind-key -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
# 最後までスクロールダウンするとコピーモードを抜ける
bind-key -n WheelDownPane select-pane -t= \; send-keys -M
## --------------------ペイン--------------------
# 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 v split-window -h -c '#{pane_current_path}'
# ペインを水平分割する
bind s split-window -v -c '#{pane_current_path}'
# ペイン番号を表示
bind i display-panes
# ペインを終了
bind q kill-pane
# https://github.com/egel/tmux-gruvbox/blob/master/tmux-gruvbox-dark.conf
## COLORSCHEME: gruvbox dark (medium)
set-option -g status "on"
# default statusbar color
set-option -g status-style bg=colour237,fg=colour223 # bg=bg1, fg=fg1
# default window title colors
set-window-option -g window-status-style bg=colour214,fg=colour237 # bg=yellow, fg=bg1
# default window with an activity alert
set-window-option -g window-status-activity-style bg=colour237,fg=colour248 # bg=bg1, fg=fg3
# active window title colors
set-window-option -g window-status-current-style bg=red,fg=colour237 # fg=bg1
# pane border
set-option -g pane-active-border-style fg=colour250 #fg2
set-option -g pane-border-style fg=colour237 #bg1
# message infos
set-option -g message-style bg=colour239,fg=colour223 # bg=bg2, fg=fg1
# writing commands inactive
set-option -g message-command-style bg=colour239,fg=colour223 # bg=fg3, fg=bg1
# pane number display
set-option -g display-panes-active-colour colour250 #fg2
set-option -g display-panes-colour colour237 #bg1
# clock
set-window-option -g clock-mode-colour colour109 #blue
# bell
set-window-option -g window-status-bell-style bg=colour167,fg=colour235 # bg=red, fg=bg
## Theme settings mixed with colors (unfortunately, but there is no cleaner way)
set-option -g status-justify "left"
set-option -g status-left-style none
set-option -g status-left-length "80"
set-option -g status-right-style none
set-option -g status-right-length "80"
set-window-option -g window-status-separator ""
set-option -g status-left "#[bg=colour241,fg=colour248] #S #[bg=colour237,fg=colour241,nobold,noitalics,nounderscore]"
set-option -g status-right "#[bg=colour237,fg=colour239 nobold, nounderscore, noitalics]#[bg=colour239,fg=colour246] %Y-%m-%d %H:%M #[bg=colour239,fg=colour248,nobold,noitalics,nounderscore]#[bg=colour248,fg=colour237] #h "
set-window-option -g window-status-current-format "#[bg=colour214,fg=colour237,nobold,noitalics,nounderscore]#[bg=colour214,fg=colour239] #I #[bg=colour214,fg=colour239,bold] #W#{?window_zoomed_flag,*Z,} #[bg=colour237,fg=colour214,nobold,noitalics,nounderscore]"
set-window-option -g window-status-format "#[bg=colour239,fg=colour237,noitalics]#[bg=colour239,fg=colour223] #I #[bg=colour239,fg=colour223] #W #[bg=colour237,fg=colour239,noitalics]"
# vim: set ft=tmux tw=0 nowrap:
# --- copy mode ---
# Mac OS X pasteboardを使用できるようにする
# set-option -g default-command "reattach-to-user-namespace -l zsh"
# コピーモードでvimキーバインドを使う
setw -g mode-keys vi
# 'v' で選択を始める
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# `Enter` でもcopy-pipeを使う
# 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"
# ']' でpbpasteを使う
# bind ] run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# bind -T copy-mode Enter send-keys -X copy-pipe-and-cancel "pbcopy"
set-option -g history-limit 10000
bind-key t choose-tree
#set-window-option -g window-status-current-format "#{?#{m:#W,zsh},#{=/8/…:#{?#{m:#{pane_current_path},${HOME}},~,#{b:pane_current_path}}},#W}