-
Notifications
You must be signed in to change notification settings - Fork 13
/
.tmux.conf
216 lines (175 loc) · 6.12 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
206
207
208
209
210
211
212
213
214
215
216
# Unbind all keys
unbind-key -a
# Set the terminal type so colors get rendered correctly
set -g default-terminal "screen-256color"
set -g default-shell "/usr/local/bin/zsh"
set -g default-command "zsh"
# set -g default-command "reattach-to-user-namespace -l ${SHELL}"
set -g renumber-windows on
# Powerline settings
set -g status on
set -g status-interval 2
set -g status-justify "centre"
set -g status-left-length 100
set -g status-right-length 100
set -g status-left "#(~/.dotfiles/.tmux/tmux-powerline/powerline.sh left)"
set -g status-right "#(~/.dotfiles/.tmux/tmux-powerline/powerline.sh right)"
set -g status-bg colour235
set -g status-fg colour255
setw -g window-status-current-format "#[fg=colour235, bg=colour27]#[fg=colour255, bg=colour27] #I #W #[fg=colour27, bg=colour235]"
# ""
# Set inactive/active window styles
# set -g -u window-style 'fg=236,bg=colour236'
set -g -u window-style
# set -g window-style 'fg=colour248,bg=colour235'
set -g -u window-active-style
set -g window-active-style 'bg=colour235'
# set -g window-active-style 'fg=white,bg=black'
# Set the pane border colors
# set -g pane-border-fg colour250
# set -g pane-border-bg colour236
set -g -u pane-border-style
set -g -u pane-active-border-style
# set -g pane-active-border-fg white
# set -g pane-border-style "fg=white,bg=white"
# set -g pane-active-border-style "fg=white,bg=white"
# set -g pane-active-border-bg colour220
set -g -u pane-active-border-style
# set -g -u pane-border-style
# History setting
set -g history-limit 100000
# Make switching to cmd mode in zsh quick!
# set -s escape-time 0
set -s escape-time 10
# tmux messages are displayed for 4 seconds
set -g display-time 4000
# focus events enabled for terminals that support them
# set -g focus-events on
set -g status-keys emacs
# vi-style controls in copy mode
setw -g mode-keys vi
# Turn on aggressive resize
# setw -g aggressive-resize on
# Set the prefix key to Ctrl-z
set -g prefix C-z
# Start pane numbering at 1
set -g base-index 1
# Load the solarized color theme
# source ~/.dotfiles/.tmux/tmux-colors-solarized/tmuxcolors-256.conf
# Sane scrolling
# set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# set -g terminal-overrides '\*:smcup@:rmcup@'
# Set window notifications
set -g visual-activity on
setw -g monitor-activity on
############################### KEY BINDINGS ##################################
# Ctrl-R: Reload tmux config
bind r source-file ~/.tmux.conf \; display 'Config reloaded'
# Ctrl-[HJKL]: Switch panes
bind C-H select-pane -L
bind C-L select-pane -R
bind C-J select-pane -D
bind C-K select-pane -U
# Ctrl-Z: Switch to last pane
bind C-Z last-pane
# Ctrl-O: Rotate pane
bind C-O rotate-window
# Ctrl-B: Break pane
bind C-B break-pane
# Ctrl-P: Next layout
bind C-P next-layout
# Ctrl-Q: Detach
bind C-Q detach-client
# Ctrl-0: Clock!
bind 0 clock-mode
# ;: Command prompt
bind \; command-prompt
# /: List keys
# bind / list-keys
# Alt-Arrow: Resize panes
bind -n M-Left resize-pane -L 5
bind -n M-Right resize-pane -R 5
bind -n M-Up resize-pane -U 5
bind -n M-Down resize-pane -D 5
# PageUp
bind -n Pageup copy-mode -u
# Alt keys generally deal with windows and sessions
# Alt-h: Previous window
bind -n M-h prev
bind -n M-H prev
# Alt-l: Next window
bind -n M-l next
bind -n M-L next
# Alt-n: New window
bind -n M-n new-window -c "#{pane_current_path}"
# Alt-t: New session
bind -n M-t command-prompt "new-session -s '%%'"
# Alt-p: Choose session. Use fzf
bind -n M-p new-window 'session=$(tmux list-sessions -F "#{session_name}" | fzf --query="$1" --select-1 --exit-0) && tmux switch-client -t "$session"'
# Alt-[: Switch to previous session
# bind -n M-[ switch-client -p \; refresh-client -S
# Alt-]: Switch to next session
# bind -n M-] switch-client -n \; refresh-client -S
# Alt-m: Zoom window and back
bind -n M-m resize-pane -Z \; display 'Zoom zoom zoom!'
# Alt-b: Break pane
bind -n M-b break-pane
# Alt-r: Rename window
bind -n M-r command-prompt -I "#W" "rename-window '%%'"
# Alt-Shift-r: Rename session
bind -n M-R command-prompt -I "#S" "rename-session '%%'"
# Alt-[1-9]: Switch to window
bind -n M-1 select-window -t :1
bind -n M-2 select-window -t :2
bind -n M-3 select-window -t :3
bind -n M-4 select-window -t :4
bind -n M-5 select-window -t :5
bind -n M-6 select-window -t :6
bind -n M-7 select-window -t :7
bind -n M-8 select-window -t :8
bind -n M-9 select-window -t :9
# Alt-q: Choose last session
bind -n M-q switch-client -l \; refresh-client -S
# Alt-w: Close pane
bind -n M-w kill-pane
# Alt-\: Split veritically
bind -n M-\ split-window -h -c "#{pane_current_path}"
# Alt--: Split horizontally
bind -n M-- split-window -v -c "#{pane_current_path}"
# Alt-c: Copy mode
bind -n M-c copy-mode
# Alt-f: Copy mode and search up
bind -n M-f copy-mode \; send-keys ?
# Alt-0: Display panes
bind -n M-0 display-panes
# Ctrl-Shift-Left/Right: Move window
bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1
# Copy mode behaves more like vim
# bind -t vi-copy v begin-selection
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
# bind -t vi-copy V rectangle-toggle
# Mouse mode
set -g mouse on
bind -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 -n WheelDownPane select-pane -t= \; send-keys -M
# This allows me to change the selection and press 'y' to copy if I wish
# unbind -t vi-copy MouseDragEnd1Pane
# bind-key -t vi-copy MouseDragEnd1Pane copy-selection -x
# bind -t vi-copy MouseDragEnd1Pane copy-pipe "reattach-to-user-namespace pbcopy"
setw -g xterm-keys on
# Bind [ and ] to some common used layout
bind [ select-layout even-horizontal
bind ] select-layout even-vertical
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
# set -g @plugin 'tmux-plugins/tmux-resurrect'
# set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'Morantron/tmux-fingers'
set -g @fingers-compact-hints 0
set -g @fingers-key C-f
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'