-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
90 lines (75 loc) · 2.89 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
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
# ================================================
# === General settings ===
# ================================================
set -g default-terminal "screen-256color"
set -g repeat-time 300
# ================================================
# Change prefix key to C-a, easier to type, same to "screen"
# ================================================
unbind C-b
set -g prefix C-a
# ================================================
# Edit configuration and reload
# ================================================
bind C-e new-window -n 'tmux.conf' "sh -c '\${EDITOR:-vim} ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display \"Config reloaded\"'"
# Reload tmux configuration
bind C-r source-file ~/.tmux.conf \; display "Config reloaded"
# ================================================
# Set parent terminal title to reflect current window in tmux session
# ================================================
set -g set-titles on
set -g set-titles-string "#I:#W"
# ================================================
# Enable mouse support
# ================================================
set -g mouse on
# ================================================
# Easier and faster switching between next/prev window
# ================================================
bind C-p previous-window
bind C-n next-window
bind C-c new-window
bind C-k kill-pane
bind C-a last-window
bind C-d detach
bind C-j command-prompt -p "Join pane from: " "join-pane -h -s %%"
bind C-b command-prompt -p "Break pane to: " "break-pane -t %%"
bind C-v split-window -h
bind C-h split-window -v
bind C-Space next-layout
# ================================================
# === Copy mode, scroll and clipboard ===
# ================================================
set -g @copy_use_osc52_fallback on
# Prefer vi style key table
setw -g mode-keys vi
bind -n C-p paste-buffer
bind -n C-o choose-buffer
# only for macos if available
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
# ================================================
# === Appearence and status bar ===
# ================================================
wg_user_host="#[fg=$color_secondary]#(whoami)#[default]@#H"
client_prefix="#{?client_prefix,#[reverse]<C-Prefix>#[noreverse] ,}"
# Active window title color
setw -g window-status-current-style fg=black,bg=yellow
set -g status on
set -g status-interval 5
set -g status-justify left
set -g status-right-length 100
set -g status-right " $client_prefix | $wg_user_host | %a %Y-%m-%d %H:%M"
# ================================================
# === Nesting local
# ================================================
bind -T root F12 \
set prefix None \;\
set key-table off \;\
set status-style "bg=grey" \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F12 \
set -u prefix \;\
set -u key-table \;\
set -u status-style \;\
refresh-client -S