-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtmux.conf
More file actions
220 lines (164 loc) · 7.65 KB
/
Copy pathtmux.conf
File metadata and controls
220 lines (164 loc) · 7.65 KB
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
set -g prefix C-a
unbind C-b
bind a send-prefix
set -g default-shell $SHELL
# macOS: use reattach-to-user-namespace for clipboard
if-shell "uname | grep -q Darwin" "set -g default-command 'reattach-to-user-namespace -l ${SHELL}'"
# Set scrollback buffer to 10000 lines
set -g history-limit 10000
set -g pane-active-border-style bg=default,fg=black
set -g pane-border-style fg=black
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
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 -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
# Bring back clear screen under tmux prefix
bind C-l send-keys 'C-l'
# start numbering windows from 1 instead of zero
set -g base-index 1
# Faster escape sequences (default is 500ms).
# This helps when exiting insert mode in Vim: http://superuser.com/a/252717/65504
set -s escape-time 10
set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Have new windows and panes open in the current directory
bind '"' split-window -c '#{pane_current_path}'
bind % split-window -c '#{pane_current_path}' -h
bind c new-window -c '#{pane_current_path}'
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
bind R source-file ~/.tmux.conf
# set -g status-bg colour234
# set -g status-fg colour254
unbind p
bind p paste-buffer
set-option -g renumber-windows on
setw -g monitor-activity on
set -g visual-activity on
bind Down resize-pane -D 5
bind Up resize-pane -U 5
bind Left resize-pane -L 5
bind Right resize-pane -R 5
set -g set-clipboard on
set -g mouse on
set-option -g status-keys vi
set-window-option -g mode-keys vi
# bind-key -T copy-mode-vi WheelUpPane send-keys -X halfpage-up
# bind-key -T copy-mode-vi WheelDownPane send-keys -X halfpage-down
# bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
# bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
# bind-key -T copy-mode-vi DoubleClick1Pane copy-mode\; send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi DoubleClick1Pane send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind -T copy-mode-vi WheelUpPane send-keys -X scroll-up
bind -T copy-mode-vi WheelDownPane send-keys -X scroll-down
bind R source-file ~/.tmux.conf \; display-message "tmux config reloaded"
set -g prefix C-a
unbind C-b
bind a send-prefix
set -g default-shell $SHELL
# set -g default-command "reattach-to-user-namespace -l ${SHELL}"
set -g pane-active-border-style bg=default,fg=black
set -g pane-border-style fg=black
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
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 -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
# Bring back clear screen under tmux prefix
bind C-l send-keys 'C-l'
# start numbering windows from 1 instead of zero
set -g base-index 1
# Faster escape sequences (default is 500ms).
# This helps when exiting insert mode in Vim: http://superuser.com/a/252717/65504
set -s escape-time 10
set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Have new windows and panes open in the current directory
bind '"' split-window -c '#{pane_current_path}'
bind % split-window -c '#{pane_current_path}' -h
bind c new-window -c '#{pane_current_path}'
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
bind R source-file ~/.tmux.conf
# set -g status-bg colour234
# set -g status-fg colour254
unbind p
bind p paste-buffer
set-option -g renumber-windows on
setw -g monitor-activity on
set -g visual-activity on
bind Down resize-pane -D 5
bind Up resize-pane -U 5
bind Left resize-pane -L 5
bind Right resize-pane -R 5
set -g set-clipboard on
set -g mouse on
set-option -g status-keys vi
set-window-option -g mode-keys vi
# Use system clipboard for copying
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi DoubleClick1Pane send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi WheelUpPane send-keys -X scroll-up
bind-key -T copy-mode-vi WheelDownPane send-keys -X scroll-down
bind r source-file ~/.tmux.conf \; display-message "tmux config reloaded"
##------------------------ THEME
thm_bg="#1e1e2e"
# set -g status-bg "${thm_bg}"
# bind -T copy-mode DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-and-cancel "pbcopy"
# bind -T copy-mode-vi DoubleClick1Pane select-pane \; send -X select-word \; send -X copy-pipe-and-cancel "pbcopy"
# bind -n DoubleClick1Pane select-pane \; copy-mode -M \; send -X select-word \; send -X copy-pipe-and-cancel "pbcopy"
# bind -T copy-mode TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "pbcopy"
# bind -T copy-mode-vi TripleClick1Pane select-pane \; send -X select-line \; send -X copy-pipe-no-clear "pbcopy"
# bind -n TripleClick1Pane select-pane \; copy-mode -M \; send -X select-line \; send -X copy-pipe-no-clear "pbcopy"
##------------------------ THEME
thm_bg="#1e1e2e"
# set -g status-bg "${thm_bg}"
set -g update-environment "SSH_AUTH_SOCK SSH_AGENT_PID"
# Disable window title
set -g set-titles off
# Hide date/time from status bar
set -g status-right ''
# Move windows left/right with Shift+Arrow (no prefix needed)
bind-key -n S-Left swap-window -t -1\; select-window -t -1
bind-key -n S-Right swap-window -t +1\; select-window -t +1
# Alternative: Move windows with prefix + Shift + Arrow
bind-key S-Left swap-window -t -1\; select-window -t -1
bind-key S-Right swap-window -t +1\; select-window -t +1