-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
61 lines (50 loc) · 1.99 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
# General Settings
set -sg escape-time 0
set -g history-limit 100000
set -g allow-rename off
# Prefix Settings
set -g prefix C-a
bind C-a send-prefix
unbind C-b
# Key Bindings
# Window/Pane Management
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# VI Mode
set-window-option -g mode-keys vi
# Activity Monitoring
setw -g monitor-activity on
set -g visual-activity on
# Status Bar Settings
set-option -g status on
set -g status-interval 5
set -g status-justify centre
# Colors
set-option -g status-bg colour235
set-option -g status-fg brightwhite
# Network Check Function
status_net="#[fg=yellow]Remote #[fg=green]#h : \
#(if ip addr show dev tun0 2>/dev/null | grep -q 'inet '; then \
echo -n '#[fg=brightyellow]tun0: ' && ip addr show dev tun0 | grep -oP 'inet \\K[\\d.]+'; \
elif tailscale status | grep johnny; then \
echo -n '#[fg=blue]tailscale0: ' && ip addr show dev tailscale0 | grep -oP 'inet \\K[\\d.]+'; \
elif ip link show eth0 2>/dev/null | grep -q 'state UP'; then \
echo -n '#[fg=red]eth0: ' && ip addr show dev eth0 | grep -v 'inet 10\\.' | grep -v 'inet 172\\.' | grep -v 'inet 192\\.168\\.' | grep -oP 'inet \\K[\\d.]+' | head -n1; \
elif ip link show eno1 2>/dev/null | grep -q 'state UP'; then \
echo -n '#[fg=red]eno1: ' && ip addr show dev eno1 | grep -oP 'inet \\K[\\d.]+'; \
else \
echo -n '#[fg=red]no-network'; \
fi)"
# Left Status Bar
set -g status-left-length 70
set -g status-left "$status_net"
# Right Status Bar
set -g status-right-length 60
set -g status-right "#[fg=brightblue]#S #I:#P #[fg=green]#(TZ=America/Chicago date +'%k:%M:%S') (#(date -u | awk '{print $4}') UTC)"
# Plugin Management
set -g @plugin 'tmux-plugins/tmux-logging'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'