-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.tmux.conf
153 lines (120 loc) · 4.83 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
#run-shell "powerline-daemon -q"
# Prefix
set-option -g prefix C-z
# status
set -g status-interval 10
set-option -g buffer-limit 32
set-option -g history-limit 200000
set-option -g default-command ""
# KeyBindings
# pane
unbind 1
bind 1 break-pane
bind 2 split-window -v
bind 3 split-window -h
bind C-p kill-window
bind C-r source-file ~/.tmux.conf
unbind &
bind -r ^[ copy-mode
bind -r ^] paste-buffer
unbind y
bind y choose-buffer
set -s escape-time 0
bind C-c source-file ~/.config/tmux/new-session-h
bind c source-file ~/.config/tmux/new-session
bind 0 kill-pane
# ウィンドウのインデックスを1から始める
set -g base-index 1
# ペインのインデックスを1から始める
setw -g pane-base-index 1
# | でペインを縦に分割する
# - でペインを横に分割する
# https://unix.stackexchange.com/questions/12032/how-to-create-a-new-window-on-the-current-directory-in-tmux/12091
# bind | split-window -h -c "#{pane_current_path}"
# bind - split-window -v -c "#{pane_current_path}"
# 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
# マウス操作を有効にする
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'"
# true color
set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
set-window-option -g mode-keys vi
bind -Tcopy-mode-vi 'v' send -X begin-selection
bind -Tcopy-mode-vi 'y' send -X copy-selection
## copy to clipboard
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
### for Linux
if-shell "which xsel" '\
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel "xsel -ib"; \
bind-key -T copy-mode-vi enter send -X copy-pipe-and-cancel "xsel -ib"; \
'
### for Cygwin
if-shell "which putclip" '\
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel "iconv -s -t SJIS | putclip"; \
bind-key -T copy-mode-vi enter send -X copy-pipe-and-cancel "iconv -s -t SJIS | putclip"; \
'
# prefix + r で設定ファイルを再読み込み
unbind r
bind r source-file ~/.tmux.conf
# 複数 pane 同期設定
bind e set-window-option synchronize-panes
# https://github.com/blueyed/vim-diminactive
set -g focus-events on
#### COLOUR (Solarized 256)
# active window title colors
set-window-option -g window-status-current-style fg=colour166,bg=default
#set-window-option -g window-status-current-attr bright
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour colour64 #green
# bell
set-window-option -g window-status-bell-style fg=colour235,bg=colour160 #base02, red
# on vim
# :Tmuxline lightline
# :TmuxlineSnapshot <file>
# This tmux statusbar config was created by tmuxline.vim
# on Wed, 06 May 2020
set -g status-justify "left"
set -g status "on"
set -g status-left-style "none"
set -g message-command-style "fg=colour153,bg=colour59"
set -g status-right-style "none"
set -g pane-active-border-style "fg=colour74"
set -g status-style "none,bg=colour236"
set -g message-style "fg=colour153,bg=colour59"
set -g pane-border-style "fg=colour59"
set -g status-right-length "100"
set -g status-left-length "100"
setw -g window-status-activity-style "none"
setw -g window-status-separator ""
setw -g window-status-style "none,fg=colour74,bg=colour236"
set -g status-left "#[fg=colour59,bg=colour74] #S #[fg=colour74,bg=colour236,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=colour74] #(tmux-mem-cpu-load --interval 2) #[fg=colour59,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour153,bg=colour59] %Y-%m-%d %H:%M #[fg=colour74,bg=colour59,nobold,nounderscore,noitalics]#[fg=colour59,bg=colour74] #h "
setw -g window-status-format "#[fg=colour74,bg=colour236] #I #[fg=colour74,bg=colour236] #W "
setw -g window-status-current-format "#[fg=colour236,bg=colour59,nobold,nounderscore,noitalics]#[fg=colour153,bg=colour59] #I #[fg=colour153,bg=colour59] #W #[fg=colour59,bg=colour236,nobold,nounderscore,noitalics]"
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'pschmitt/tmux-ssh-split'
set-option -g @ssh-split-keep-cwd "true"
set-option -g @ssh-split-fail "false"
set-option -g @ssh-split-no-shell "false"
set-option -g @ssh-split-strip-cmd "true"
set-option -g @ssh-split-verbose "true"
set-option -g @ssh-split-h-key "|"
set-option -g @ssh-split-v-key "-"
run '~/.tmux/plugins/tpm/tpm'