-
Notifications
You must be signed in to change notification settings - Fork 477
Expand file tree
/
Copy path.tmux.conf
More file actions
143 lines (116 loc) · 5.26 KB
/
.tmux.conf
File metadata and controls
143 lines (116 loc) · 5.26 KB
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
# Solarized Dark palette (256-color approximation):
# base03=colour234 base02=colour235 base01=colour240 base00=colour241
# base0=colour244 base1=colour245 yellow=colour136 orange=colour166
# red=colour160 magenta=colour125 violet=colour61 blue=colour33
# cyan=colour37 green=colour64
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
# Theme
set-option -g status-style bg=colour235,fg=colour136,default # base02, yellow
# default window title colors
set-window-option -g window-status-style fg=colour244,bg=default,dim # fg=base0
# active window title colors
set-window-option -g window-status-current-style fg=colour166,bg=default,bright # fg=orange
# pane border
set-option -g pane-border-style fg=colour61 #violet
set-option -g pane-active-border-style fg=colour64 #green
# message text
set-option -g message-style bg=colour235,fg=colour166 # bg=base02, fg=orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour green #green
set -g status-interval 1
set -g status-justify centre # center align window list
set -g status-left-length 20
set -g status-right-length 140
set -g status-left '#[fg=green]#H #[fg=black]• #[fg=green,bright]#(uname -r | cut -c 1-6)#[default]'
set -g status-right '#[fg=green,bg=default,bright]#(tmux-mem-cpu-load) #[fg=red,dim,bg=default]#(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") #[fg=white,bg=default]%a%l:%M:%S %p#[default] #[fg=blue]%Y-%m-%d'
# C-b is not acceptable -- Vim uses it
set-option -g prefix C-a
bind-key C-a last-window
# Start numbering at 1
set -g base-index 1
# Allows for faster key repetition
set -s escape-time 50
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# Allows us to use C-a a <command> to send commands to a TMUX session inside
# another TMUX session
bind-key a send-prefix
# Activity monitoring
setw -g monitor-activity on
set -g visual-activity on
# Vi copypaste mode
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel
bind-key -T copy-mode-vi C-v send -X rectangle-toggle
# Mouse off
set -g mouse off
# Splits preserving current path
bind-key -N "New window" c new-window -c "#{pane_current_path}"
bind-key -N "Split horizontal" '"' split-window -v -c "#{pane_current_path}"
bind-key -N "Split vertical" v split-window -h -c "#{pane_current_path}"
bind-key -N "Split horizontal" b split-window -v -c "#{pane_current_path}"
bind-key -N "Split vertical" % split-window -h -c "#{pane_current_path}"
# hjkl pane traversal
bind-key -N "Select pane left" h select-pane -L
bind-key -N "Select pane down" j select-pane -D
bind-key -N "Select pane up" k select-pane -U
bind-key -N "Select pane right" l select-pane -R
# Layouts (integer fallback for 3.1)
bind-key -N "Main-horizontal" m select-layout main-horizontal
bind-key -N "Main-vertical" M select-layout main-vertical
bind-key -N "New named window" C command-prompt -p "Name of new window: " "new-window -n '%%'"
# reload config
bind-key -N "Reload config" r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# Quick-action menu
bind Space display-menu -T "Quick Actions" \
"Horizontal Split" h "split-window -v -c '#{pane_current_path}'" \
"Vertical Split" v "split-window -h -c '#{pane_current_path}'" \
"" \
"Swap Up" u "swap-pane -U" \
"Swap Down" d "swap-pane -D" \
"" \
"Kill Pane" x "kill-pane" \
"Kill Window" X "kill-window"
# auto window rename
set-window-option -g automatic-rename
# Terminal (base — works on all 3.x)
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
set -g focus-events on
set -g history-limit 50000
# --- Version-gated features ---
# 3.2+: terminal-features, extended-keys, popups, clipboard
if-shell -F "#{>=:#{version},3.2}" {
set -as terminal-features ",xterm-256color:RGB:extkeys"
set -g extended-keys on
bind-key -n C-Enter send-keys Escape "[13;5u"
bind-key -n S-Enter send-keys Escape "[13;2u"
bind-key -N "Main-horizontal 66%" m setw main-pane-height 66% \; select-layout main-horizontal
bind-key -N "Main-vertical 50%" M setw main-pane-width 50% \; select-layout main-vertical
bind-key -N "Popup shell" t display-popup -E -w 80% -h 80%
bind-key -N "Popup git log" g display-popup -E -w 80% -h 80% "git log --oneline --graph -30"
set -g copy-mode-match-style "bg=colour136,fg=colour235"
set -g copy-mode-current-match-style "bg=colour166,fg=colour235,bold"
set -s set-clipboard on
if-shell "command -v clip.exe" {
set -s copy-command "clip.exe"
} {
if-shell "command -v pbcopy" {
set -s copy-command "pbcopy"
} {
if-shell "command -v xclip" {
set -s copy-command "xclip -selection clipboard >/dev/null"
}
}
}
}
# 3.3+: pane border arrows
if-shell -F "#{>=:#{version},3.3}" {
set -g pane-border-indicators arrows
}