-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_tmux.conf
203 lines (170 loc) · 9.6 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
193
194
195
196
197
198
199
200
201
202
203
## Basic Settings
set -g default-shell "/usr/local/bin/fish" # Default shell executable
set -g default-command "/usr/local/bin/fish" # Default command for new windows
# remap prefix to Control + a
set -g prefix C-a
# bind 'C-a C-a' to type 'C-a'
bind C-a send-prefix
unbind C-b
# tmux vi mode is buggy, use emacs instead
# navigate using emacs
set-option -g status-keys emacs
set-window-option -g mode-keys emacs
bind-key c command-prompt -p "Name of new window: " "new-window -n '%%'"
# make delay shorter
set -sg escape-time 0
# reload config file
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded."
bind-key m set -g status
bind-key 0 last-window
# FIXME not work with native tmux command
bind-key 9 run 'tmux select-window -t #{session_windows}'
# vi keymap in emacs mode
bind-key -T copy-mode C-l send-keys -X clear-selection
bind-key -T copy-mode \# send-keys -FX search-backward "#{copy_cursor_word}"
bind-key -T copy-mode \$ send-keys -X end-of-line
bind-key -T copy-mode \% send-keys -X next-matching-bracket
bind-key -T copy-mode * send-keys -FX search-forward "#{copy_cursor_word}"
bind-key -T copy-mode / command-prompt -i -I "#{pane_search_string}" -p "(search down)" "send -X search-forward-incremental \"%%%\""
bind-key -T copy-mode ? command-prompt -i -I "#{pane_search_string}" -p "(search up)" "send -X search-backward-incremental \"%%%\""
bind-key -T copy-mode 0 send-keys -X start-of-line
bind-key -T copy-mode 1 command-prompt -N -I 1 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode 2 command-prompt -N -I 2 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode 3 command-prompt -N -I 3 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode 4 command-prompt -N -I 4 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode 5 command-prompt -N -I 5 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode 6 command-prompt -N -I 6 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode 7 command-prompt -N -I 7 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode 8 command-prompt -N -I 8 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode 9 command-prompt -N -I 9 -p (repeat) { send-keys -N "%%" }
bind-key -T copy-mode : command-prompt -p "(goto line)" { send-keys -X goto-line "%%" }
bind-key -T copy-mode A send-keys -X append-selection-and-cancel
bind-key -T copy-mode B send-keys -X previous-space
bind-key -T copy-mode D send-keys -X copy-pipe-end-of-line-and-cancel
bind-key -T copy-mode E send-keys -X next-space-end
bind-key -T copy-mode F command-prompt -1 -p "(jump backward)" { send-keys -X jump-backward "%%" }
bind-key -T copy-mode g send-keys -X history-top
bind-key -T copy-mode G send-keys -X history-bottom
bind-key -T copy-mode J send-keys -X scroll-down
bind-key -T copy-mode K send-keys -X scroll-up
bind-key -T copy-mode N send-keys -X search-reverse
bind-key -T copy-mode T command-prompt -1 -p "(jump to backward)" { send-keys -X jump-to-backward "%%" }
bind-key -T copy-mode V send-keys -X select-line
bind-key -T copy-mode W send-keys -X next-space
bind-key -T copy-mode b send-keys -X previous-word
bind-key -T copy-mode e send-keys -X next-word-end
bind-key -T copy-mode f command-prompt -1 -p "(jump forward)" { send-keys -X jump-forward "%%" }
bind-key -T copy-mode h send-keys -X cursor-left
bind-key -T copy-mode j send-keys -X cursor-down
bind-key -T copy-mode k send-keys -X cursor-up
bind-key -T copy-mode l send-keys -X cursor-right
bind-key -T copy-mode n send-keys -X search-again
bind-key -T copy-mode o send-keys -X other-end
bind-key -T copy-mode q send-keys -X cancel
bind-key -T copy-mode r send-keys -X refresh-from-pane
bind-key -T copy-mode t command-prompt -1 -p "(jump to forward)" { send-keys -X jump-to-forward "%%" }
bind-key -T copy-mode v send-keys -X begin-selection
bind-key -T copy-mode w send-keys -X next-word
bind-key -T copy-mode y send-keys -X copy-selection
bind-key -T copy-mode \{ send-keys -X previous-paragraph
bind-key -T copy-mode \} send-keys -X next-paragraph
bind-key -T copy-mode Up send-keys -X cursor-up
bind-key -T copy-mode Down send-keys -X cursor-down
bind-key -T copy-mode Left send-keys -X cursor-left
bind-key -T copy-mode Right send-keys -X cursor-right
## UI
set-option -g status-position top
set-option -g focus-events on
# solve tmux vim background color issue
set -g default-terminal 'xterm-256color'
set -as terminal-overrides ',xterm*:Tc:sitm=\E[3m'
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
# TODO statistics a better value
set-option -g history-limit 10000
## KeyMap
# Split panes horizontally
bind-key \\ split-window -h -c '#{pane_current_path}'
# Split panes vertically
bind-key - split-window -v -c '#{pane_current_path}'
# pane movement shortcuts
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
## Plugin
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'laktak/extrakto'
set -g @plugin 'sainnhe/tmux-fzf'
# plugin config
set -g @extrakto_copy_key "tab" # use tab to copy to clipboard
set -g @extrakto_insert_key "enter" # use enter to insert selection
set -g @extrakto_grab_area "full"
TMUX_FZF_ORDER="session|window|pane|command|keybinding|process"
TMUX_FZF_OPTIONS="-p -w 90% -h 90% -m"
# LACKLUSTER THEME BEGIN
color_lack="#708090"
color_luster="#deeeed"
color_orange="#ffaa88"
color_green="#789978"
color_blue="#7788AA"
color_red="#D70000"
color_black="#000000"
color_gray1="#080808"
color_gray2="#191919"
color_gray3="#2a2a2a"
color_gray4="#444444"
color_gray5="#555555"
color_gray6="#7a7a7a"
color_gray7="#aaaaaa"
color_gray8="#cccccc"
color_gray9="#DDDDDD"
# by default window names will just be their index
set-option -g automatic-rename on
set-option -g automatic-rename-format "#I"
# set to 12 for a 12-hour clock
set-option -g clock-mode-style 24
set-option -g clock-mode-colour "$color_gray6"
# NOTE: color variable expansion only works in double quotes
set-option -g status-fg "$color_luster"
set-option -g status-bg "$color_gray2"
set-option -g copy-mode-current-match-style "fg=$color_gray1,bg=$color_gray8"
set-option -g copy-mode-match-style "fg=$color_gray1,bg=$color_gray8"
set-option -g menu-selected-style "fg=$color_gray1,bg=$color_luster"
set-option -g menu-style "fg=$color_luster,bg=$color_gray1"
set-option -g message-style "bg=$color_gray6,fg=$color_gray1" # command in vi-insert mode
set-option -g message-command-style "bg=$color_gray6,fg=$color_gray4" # command in vi-normal mode
set-option -g mode-style "bg=$color_gray8,fg=$color_gray1"
set-option -g pane-active-border-style "fg=$color_gray1"
set-option -g pane-border-lines "heavy"
set-option -g pane-border-style "fg=$color_gray5"
set-option -g popup-border-lines "rounded"
set-option -g status-right-style "fg=$color_gray6"
set-option -g window-status-current-style "fg=$color_gray8"
set-option -g window-status-style "fg=$color_gray6"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
# status left look and feel
set -g status-left-length 100
set -g status-left ""
set -ga status-left "#{?client_prefix,#{#[bg=#{color_green},fg=#{color_black},bold] #S },#{#[bg=#{color_black},fg=#{color_green}] #S }}"
set -ga status-left "#[bg=#{color_black},fg=#{color_gray6},none]│"
# status right look and feel
set -g status-right-length 100
set -g status-right ""
set -ga status-right "#[bg=#{color_black},fg=#{color_orange}]#{?window_zoomed_flag, zoom ,}"
set -ga status-right "#[bg=#{color_black},fg=#{color_blue}] %m-%d %H:%M "
# Configure Tmux
set -g status-style "bg=#{color_black}"
set -g window-status-format " #I#{?#{!=:#{window_name},Window},: #W,} "
set -g window-status-style "bg=#{color_black},fg=#{color_gray6}"
set -g window-status-last-style "bg=#{color_black},fg=#{color_blue}"
set -g window-status-activity-style "bg=#{color_red},fg=#{color_black}"
set -g window-status-bell-style "bg=#{color_red},fg=#{color_black},bold"
set -gF window-status-separator "#[bg=#{color_black},fg=#{color_gray6}]│"
set -g window-status-current-format " #I#{?#{!=:#{window_name},Window},: #W,} "
set -g window-status-current-style "bg=#{color_blue},fg=#{color_black},bold"
# LACKLUSTER THEME END
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'