-
Notifications
You must be signed in to change notification settings - Fork 1
/
dot_tmux.conf
192 lines (149 loc) · 6.2 KB
/
dot_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
# Change prefix key to Ctrl+a
unbind C-b
set -g prefix C-a
# prevent brief delay when hitting escape in Vim
set -gs escape-time 0
set -g default-terminal "tmux-256color"
# allow shift-PgUp and shift-PgDown to scroll windows
# Use 256 colors
set -ga terminal-overrides ",xterm*:smcup@:rmcup@,xterm-256color:RGB"
set -g history-limit 50000
# give me nice window titles
set -g set-titles on
set -g set-titles-string '#W [#S:#I #h]'
# start window numbering at 1, not 0.
set -g base-index 1
# automatically renumber windows when I close one. I.e. "pack" them.
set -g renumber-windows on
# Emacs key bindings in tmux command prompt (prefix + :) are better than
# # vi keys, even for vim users
set -g status-keys emacs
# Window options
setw -g mode-keys vi
setw -g clock-mode-style 24
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# set ctrl-left and ctrl-right to jump words
setw -g xterm-keys on
# Mouse On by default
set -g mouse on
# Show error messages long enough to read them
set -g display-time 4000
# Key Bindings
# Toggle mouse on with <prefix>M
bind M \
set -g mouse on \;\
display 'Mouse: ON'
# Toggle mouse off with <prefix>m (used when middle click pasting)
# Alternatively, just Shift-middle click to paste when in mouse mode
bind m \
set -g mouse off \;\
display 'Mouse: OFF'
# Get mouse wheel scrolling working without breaking vim
# See https://github.com/tmux/tmux/issues/145
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
bind / command-prompt -p "man page:" "split-window -h 'exec man %1'"
# screen-ism to jump to last active window
bind C-a last-window
# Easier and faster switching between next/prev window since you can just hold CTRL down
bind C-p previous-window
bind C-n next-window
bind Left swap-window -t -1
bind Right swap-window -t +1
# vim's definition of a horizontal/vertical split is reversed from tmux's
bind s split-window -v -c "#{pane_current_path}"
bind v split-window -h -c "#{pane_current_path}"
# move around panes with hjkl, as one would in vim after pressing ctrl-w
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."
# Status bar settings
set -g status-right '#[fg=brightred]#h #[fg=yellow][%m-%d %H:%M]#[default]'
# Colors - Solarized Dark
# default statusbar colors
set-option -g status-style bg=black,fg=yellow #bg=base02,fg=yellow
# default window title colors
set-window-option -g window-status-style fg=brightblue #base0
# active window title colors
set-window-option -g window-status-current-style fg=brightred #orange
# pane border
set-option -g pane-border-style fg=black #base02
set-option -g pane-active-border-style fg=brightgreen #base01
# message text
set-option -g message-style fg=brightred,bg=black #fg=orange,bg=base02
# pane number display
set-option -g display-panes-active-colour blue #blue
set-option -g display-panes-colour brightred #orange
# Rename titles to the current directory's basename
set-option -g status-interval 5
set-option -g automatic-rename on
set-option -g automatic-rename-format '#{b:pane_current_path}'
# Move windows left or right
bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1
# clock
set-window-option -g clock-mode-colour green #green
# List of plugins
# prefix I installs, prefix U updates, prefix alt-u removes
set -g @plugin 'tmux-plugins/tpm'
# prefix CTRL-S saves and prefix CTRL-R restores
set -g @plugin 'tmux-plugins/tmux-resurrect'
# prefix \ brings up the menu
set -g @plugin 'jaclu/tmux-menus'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'christoomey/vim-tmux-navigator'
# prefix F enables fingers mode
TMUX_FZF_LAUNCH_KEY="C-f"
# Default value in tmux >= 3.2
TMUX_FZF_OPTIONS="-p -w 85% -h 75% -m"
bind-key "M-p" run-shell -b "/home/awood/.tmux/plugins/tmux-fzf/scripts/pane.sh switch"
# a-z: copies selected match to the clipboard
# CTRL + a-z: copies selected match to the clipboard and triggers
# @fingers-ctrl-action. By default it triggers :open: action, which is useful
# for opening links in the browser for example.
# SHIFT + a-z: copies selected match to the clipboard and triggers
# @fingers-shift-action. By default it triggers :paste: action, which
# automatically pastes selected matches.
# ALT + a-z: copies selected match to the clipboard and triggers
# @fingers-alt-action. There is no default, configurable by the user.
# TAB: toggle multi mode. First press enters multi mode, which allows to select
# multiple matches. Second press will exit with the selected matches copied to
# the clipboard.
# q, ESC or CTRL + c: exit [fingers] mode
set -g @plugin 'Morantron/tmux-fingers'
# UUIDs
set -g @fingers-pattern-0 '^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$'
set -g @fingers-pattern-1 'git push --set-upstream .*'
# If is_vim is true, pass C-w along, otherwise use key-table ctrlw
bind-key -n C-w if-shell "$is_vim" "send-keys C-w" "switch-client -Tctrlw"
bind-key -T ctrlw 'h' select-pane -L
bind-key -T ctrlw 'j' select-pane -D
bind-key -T ctrlw 'k' select-pane -U
bind-key -T ctrlw 'l' select-pane -R
# -r allows for repeating, so hitting C-h multiple times will continue to resize
bind-key -r -T ctrlw 'C-h' resize-pane -L 2
bind-key -r -T ctrlw 'C-j' resize-pane -D 2
bind-key -r -T ctrlw 'C-k' resize-pane -U 2
bind-key -r -T ctrlw 'C-l' resize-pane -R 2
bind-key -T ctrlw '\' select-pane -l
bind-key -T ctrlw 's' split-window -v
bind-key -T ctrlw 'v' split-window -h
# Double tap to use C-w to delete a word backwards
bind-key -T ctrlw 'C-w' send-keys C-w
# This line needs to be at the bottom (except for plugin settings that you want
# to undo)
run '~/.tmux/plugins/tpm/tpm'
# vim-tmux-navigator binds CTRL-{h,j,k,l} directly which I don't want
unbind-key -n C-h
unbind-key -n C-j
unbind-key -n C-k
unbind-key -n C-l
unbind-key -T copy-mode-vi -n C-h
unbind-key -T copy-mode-vi -n C-j
unbind-key -T copy-mode-vi -n C-k
unbind-key -T copy-mode-vi -n C-l