-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyanghao.tmux.conf
182 lines (150 loc) · 6.15 KB
/
yanghao.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
################################################################################
# Author: Wenxuan Zhang #
# Email: wenxuangm@gmail.com #
# HomePage: https://github.com/wfxr #
################################################################################
if -b '[ "$SSH_CLIENT" ]' ' \
set -g status-position top; \
set -g prefix M-q; \
bind M-q resize-pane -Z; \
bind -r M-p previous-window; \
bind -r M-n next-window; \
' ' \
set -g status-position bottom; \
set -g prefix C-a; \
bind C-a resize-pane -Z; \
bind -r C-p previous-window; \
bind -r C-n next-window; \
'
# split current window horizontally
bind-key v split-window -h
bind | split-window -h
# split current window vertically
bind-key b split-window
bind _ split-window -v
bind -r tab select-pane -t :.+
bind -r btab select-pane -t :.-
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
# Change the color of the current window/pane
bind T run-shell "tmux set -p window-style 'fg=#C01C28,bg=#5E5C64'"
# Select pane
bind h select-pane -L
bind l select-pane -R
bind j select-pane -D
bind k select-pane -U
setw -g mode-keys vi
set -g repeat-time 500
# Split window
# bind _ split-window -v
# bind | split-window -h
set -g repeat-time 1000
# Move window
bind -r < swap-window -t -1
bind -r > swap-window -t +1
# rename session
bind . command-prompt -I "#S" "rename-session '%%'"
# set to main-horizontal, 66% height for main pane
bind m run-shell "~/.tmux/scripts/resize-adaptable.sh -l main-horizontal -p 66"
# Same thing for verical layouts
bind M run-shell "~/.tmux/scripts/resize-adaptable.sh -l main-vertical -p 50"
bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
# Resize panes like vim
bind -r H resize-pane -L 4
bind -r L resize-pane -R 4
bind -r J resize-pane -D 4
bind -r K resize-pane -U 4
set -g default-shell $SHELL
# TrueColor
set -g default-terminal "xterm-256color"
set -sa terminal-overrides ',xterm-256color:RGB'
# set -sa terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
set -g history-limit 102400 # boost history
set -g status-keys emacs
# Copy
setw -g mode-keys vi
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi C-v send -X rectangle-toggle
bind -T copy-mode-vi y send -X copy-selection-and-cancel
bind -T copy-mode-vi Escape send -X cancel
bind -T copy-mode-vi L send -X end-of-line
bind -T copy-mode-vi H send -X start-of-line
# Mouse support
set -g mouse on # Tmux 2.1 and later
# Index & Name
set -g base-index 1
set -g pane-base-index 1
set -g renumber-windows on
setw -g automatic-rename on
# Goyo
bind G set status
# Change default work dir
bind m attach -c '#{pane_current_path}'
# tpm {{{ #
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-yank'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'wfxr/tmux-fzf-url'
# Note: Change the plugin order carefully!
set -g @plugin 'wfxr/tmux-power'
set -g @tmux_power_theme 'gold'
set -g @tmux_power_date_icon ' '
set -g @tmux_power_time_icon ' '
set -g @tmux_power_user_icon ' '
set -g @tmux_power_session_icon ' '
set -g @tmux_power_show_upload_speed true
set -g @tmux_power_show_download_speed true
set -g @tmux_power_show_web_reachable true
# / / / /
set -g @tmux_power_upload_speed_icon ''
set -g @tmux_power_download_speed_icon ''
set -g @tmux_power_prefix_highlight_pos 'LR'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @prefix_highlight_prefix_prompt 'Wait'
set -g @prefix_highlight_copy_prompt 'Copy'
set -g @prefix_highlight_sync_prompt 'Sync'
set -g @plugin 'wfxr/tmux-web-reachable'
set -g @web_reachable_url 'https://google.com'
set -g @web_reachable_thresholds '500 750'
# set -g @web_reachable_symbols '🔵|🟢|🟡|🔴'
# set -g @web_reachable_symbols '🔵|🟢|🟡|🧱'
set -g @web_reachable_symbols '#[fg=Cyan] #[]|#[fg=Green] #[]|#[fg=Yellow] #[]|#[fg=Red] #[]'
set -g @plugin 'wfxr/tmux-net-speed'
set -g @plugin 'woodstok/tmux-butler'
bind-key -n M-i run-shell -b "$HOME/.tmux/plugins/tmux-butler/modes/quetty-filter -start word"
bind-key -n M-p run-shell -b "$HOME/.tmux/plugins/tmux-butler/modes/quetty-filter -start path"
bind-key -n M-s run-shell -b "$HOME/.tmux/plugins/tmux-butler/modes/snippets"
set -g @plugin 'junegunn/tmux-fzf-maccy'
# Bind-key (default: '@')
set -g @fzf-maccy-bind '@'
set -g @plugin 'junegunn/tmux-fzf-url'
# Bind-key (default: 'u')
set -g @fzf-url-bind 'u'
# fzf-tmux layout (default: '-p70%' on tmux 3.2, '-d' otherwise)
# (-p requires tmux 3.2 or above, see `man fzf-tmux` for available options)
set -g @fzf-url-layout '-p70%'
# fzf-tmux layout (default: '-p70%' on tmux 3.2, '-d' otherwise)
# (-p requires tmux 3.2 or above, see `man fzf-tmux` for available options)
set -g @fzf-maccy-layout '-p70%'
# if -b '"$(uname)" = Darwin' 'source-file ~/.tmux_osx.conf'
set -g @plugin 'laktak/extrakto'
# prefix + Tab - toggle sidebar with a directory tree
# prefix + Backspace - toggle sidebar and move cursor to it (focus it)
set -g @plugin 'tmux-plugins/tmux-sidebar'
# Default To launch tmux-fzf, press prefix + F (Shift+F).
set -g @plugin 'sainnhe/tmux-fzf'
# to use prefix + C-f (Ctrl+F)
TMUX_FZF_LAUNCH_KEY="C-f"
# Default value in tmux < 3.2
TMUX_FZF_OPTIONS="-m"
# Default value in tmux >= 3.2
TMUX_FZF_OPTIONS="-p -w 62% -h 38% -m"
TMUX_FZF_ORDER="session|window|pane|command|keybinding|clipboard|process"
TMUX_FZF_PANE_FORMAT="[#{window_name}] #{pane_current_command} [#{pane_width}x#{pane_height}] [history #{history_size}/#{history_limit}, #{history_bytes} bytes] #{?pane_active,[active],[inactive]}"
set -g @plugin 'tmux-plugins/tmux-fpp'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
set -g default-command "reattach-to-user-namespace -l ${SHELL}"
# }}} tpm #