-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
executable file
·205 lines (164 loc) · 6.97 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-window-option -g mode-keys vi
setw -g mode-keys vi
set-option -g status-keys vi
set -g @shell_mode 'vi'
set-window-option -g xterm-keys on
#https://github.com/Anthony25/gnome-terminal-colors-solarized
# set -g default-terminal "screen-256color"
# set -g default-terminal "st-256color"
set -g default-terminal "xterm-256color"
#set-option -g default-shell zsh
# set-option -g default-shell /run/current-system/sw/bin/zsh
# Enable UTF-8
# setw -g utf8 on
# set-option -g status-utf8 on
# Scrollback/History limit
set -g history-limit 100000
set -g @continuum-save-interval '10'
set -g @continuum-restore 'on'
set -g @continuum-boot 'on'
set -g @resurrect-processes 'false'
#set -g @resurrect-strategy-nvim 'session'
#set -g @resurrect-save-bash-history 'on'
#set -g @resurrect-capture-pane-contents 'on'
bind -n M-Down resize-pane -D 5
bind -n M-Up resize-pane -U 5
bind -n M-Left resize-pane -L 5
bind -n M-Right resize-pane -R 5
# set-window-option -g pane-base-index 1
# set-window-option -g base-index 1
# Reload the file with Prefix r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
#
# bind k resize-pane -Z
#
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
bind C-l send-keys 'C-l'
bind -Tcopy-mode-vi 'v' send -X begin-selection
bind -Tcopy-mode-vi 'y' send -X copy-selection
bind v setw synchronize-panes
bind ` kill-pane -a
# is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
# | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|\.nvim-wrapped)(diff)?$'"
# bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
# bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
# bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
# bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind -n C-k run-shell '~/scripts/tmux-vim-select-pane -U'
bind -n C-j run-shell '~/scripts/tmux-vim-select-pane -D'
bind -n C-h run-shell '~/scripts/tmux-vim-select-pane -L'
bind -n C-l run-shell '~/scripts/tmux-vim-select-pane -R'
bind -n "C-\\" run-shell '~/scripts/tmux-vim-select-pane -l'
bind-key -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
bind-key -T copy-mode-vi C-\ select-pane -l
# is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
# | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
# bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
# bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
# bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
# bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
#
# # bind-key -n C-1 select-window -t :1
# # bind-key -n C-@ select-window -t :2
# # bind-key -n C-[ select-window -t :3
# # bind-key -n C-\ select-window -t :4
# # bind-key -n C-] select-window -t :5
# # bind-key -n C-^ select-window -t :6
# # bind-key -n C-_ select-window -t :7
# # bind-key -n C-? select-window -t :8
# # bind-key -n C-9 select-window -t :9
# # bind-key -n C-0 select-window -t :0
#
# # bind-key -n C-0 select-window -t :0
# # bind-key -n C-1 select-window -t :1
# # bind-key -n C-2 select-window -t :2
# # bind-key -n C-3 select-window -t :3
# # bind-key -n C-4 select-window -t :4
# # bind-key -n C-5 select-window -t :5
# # bind-key -n C-6 select-window -t :6
# # bind-key -n C-7 select-window -t :7
# # bind-key -n C-8 select-window -t :8
# # bind-key -n C-9 select-window -t :9
### Mouse
set -g mouse on
# Toggle mouse on with ^B m
bind m \
set -g mouse on \;\
display 'Mouse: ON'
# Toggle mouse off with ^B M
bind M \
set -g mouse off \;\
display 'Mouse: OFF'
# Notification
set -g monitor-activity off
set -g visual-activity off
set-option -g bell-action none
set-option -g visual-bell off
# Automatically set window titles
set-option -g set-titles on
set-option -g set-titles-string '#H:#S.#I.#P #W #T' # window number,program name,active (or not)
# Statusbar Adjustments
# set -g status-left " "
# Show performance counters in statusbar
# Requires https://github.com/thewtex/tmux-mem-cpu-load/
# set -g status-interval 1
# set -g status-right '#[fg=white,bold]| #[fg=blue,bold]#(tmux-mem-cpu-load -m 1 -a 0 -g 5) #[fg=white,bold]| #[fg=blue,bold]#{battery_percentage} #{battery_remain}'
# set -g status-right '#(tmux-mem-cpu-load -cq -a 0) #[fg=white,bold]| #[fg=blue,bold]#{battery_percentage} #{battery_remain}'
# set -g status-right '#[bg=default,bright] Continuum #{continuum_status} | #(tmux-mem-cpu-load) | Uptime:#(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") | %d.%m.%Y | %a %H:%M:%S %p'
# set -g status-right-length 150
set -g status-right-length 0
set -g status-left-length 0
### COLOUR (Solarized dark)
# default statusbar colors
set-option -g status-bg black #base02
set-option -g status-fg yellow #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg brightblue #base0
set-window-option -g window-status-bg default
#set-window-option -g window-status-attr dim
# active window title colors
set-window-option -g window-status-current-fg brightred #orange
set-window-option -g window-status-current-bg default
#set-window-option -g window-status-current-attr bright
# pane border
set-option -g pane-border-fg black #base02
set-option -g pane-active-border-fg brightgreen #base01
# message text
set-option -g message-bg black #base02
set-option -g message-fg brightred #orange
# pane number display
set-option -g display-panes-active-colour blue #blue
set-option -g display-panes-colour brightred #orange
# clock
set-window-option -g clock-mode-colour green #green
# bell
set-window-option -g window-status-bell-style fg=black,bg=red #base02, red
set-window-option -g window-status-current-format '#[fg=white,bold]** #{window_index} #[fg=green]#{pane_current_command} #[fg=blue]#(echo "#{pane_current_path}" | rev | cut -d'/' -f-2 | rev) #[fg=white]** |'
set-window-option -g window-status-format '#[fg=white,bold]#{window_index} #[fg=green]#{pane_current_command} #[fg=blue]#(echo "#{pane_current_path}" | rev | cut -d'/' -f-2 | rev) #[fg=white]|'
#set -g @colors-solarized 'dark'
# window status by folder name
# set -g automatic-rename-format '#(echo "#{pane_current_path}" | rev | cut -d'/' -f-2 | rev)'
# set -g status-interval 1
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-sessionist'
#set -g @plugin 'thewtex/tmux-mem-cpu-load'
set -g @plugin 'christoomey/vim-tmux-navigator'
#set -g @plugin 'seebi/tmux-colors-solarized'
# Initial
run '~/.tmux/plugins/tpm/tpm'
bind-key C-a last-window
bind-key C-q switch-client -l