-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwfxr.tmux.conf
145 lines (122 loc) · 4.7 KB
/
wfxr.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
################################################################################
# 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'
# 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 '%%'"
# 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 '@'
# 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'
# 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 #