-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
173 lines (146 loc) · 6.64 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
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
# https://github.com/seebi/tmux-colors-solarized/blob/master/tmuxcolors-256.conf
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default
#set-window-option -g window-status-attr dim
# active window title colors
set-window-option -g window-status-current-fg colour166 #orange
set-window-option -g window-status-current-bg default
#set-window-option -g window-status-current-attr bright
# pane border
set-option -g pane-border-fg colour235 #base02
set-option -g pane-active-border-fg colour240 #base01
# message text
set-option -g message-bg colour235 #base02
set-option -g message-fg colour166 #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 5
set -g status-justify centre # center align window list
set -g status-left-length 30
set -g status-right-length 140
# Format: hostname@sessionname
set -g status-left '#[fg=green]#{=10:host}#[fg=white]@#[default]#{=5:session_name}'
# CPU usage
set -ag status-left '#{cpu_fg_color}#{cpu_percentage}'
# Whether prefix has been pressed
set -ag status-left '#{prefix_highlight}'
# Checks if it's online or not
set -g status-right '#[fg=green,bg=default,bright]#{online_status} '
# Internet speed
#set -g status-right '#[fg=green,bg=default,bright]#{download_speed} '
# Current computer uptime
set -ag status-right '#[fg=red,dim,bg=default]#(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") '
# Day of week and current hours:minutes
set -ag status-right '#[fg=white,bg=default]%a %T'
# Current date DD-MM-YY, no american weird standard
set -ag status-right '#[default] #[fg=blue]%d-%m-%y'
set -g base-index 1 # Start numbering at 1
set-option -g renumber-windows on #Renumber windows automatically
# Allows for faster key repetition
set -s escape-time 0
# 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
# auto window rename
set-window-option -g automatic-rename
# set default color as 256
set -g default-terminal "screen-256color"
# Mouse mode?!
# Scroll your way into copy mode (scrollback buffer)
# and select text for copying with the mouse
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
# https://github.com/edkolev/dots/blob/master/tmux.conf
# Updates for tmux 1.9's current pane splitting paths.
# from powerline
run-shell "tmux set-environment -g TMUX_VERSION_MAJOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f1 | sed 's/[^0-9]*//g')"
run-shell "tmux set-environment -g TMUX_VERSION_MINOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f2 | sed 's/[^0-9]*//g')"
# status bar
if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 2\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'set-option -g status-utf8 on'
# rm mouse mode fail
if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 1\) -o #{$TMUX_VERSION_MAJOR} -gt 2' 'set -g mouse off'
if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 1\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'set -g mode-mouse off'
# fix pane_current_path on new window and splits
if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" 'unbind c; bind c new-window -c "#{pane_current_path}"'
if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" "unbind '\"'; bind '\"' split-window -v -c '#{pane_current_path}'"
if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" 'unbind v; bind v split-window -h -c "#{pane_current_path}"'
if-shell "#{$TMUX_VERSION_MAJOR} -gt 1 -o \( #{$TMUX_VERSION_MAJOR} -eq 1 -a #{$TMUX_VERSION_MINOR} -ge 8 \)" 'unbind %; bind % split-window -h -c "#{pane_current_path}"'
## Keys section
# C-b is not acceptable -- Vim uses it
set-option -g prefix C-a
bind-key C-a last-window
# set window split
bind-key v split-window -h
bind-key b split-window
# 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 off
# Vi copypaste mode
set-window-option -g mode-keys vi
bind-key -T vi-copy 'v' begin-selection
bind-key -T vi-copy 'y' copy-selection
# vi-like hjkl pane traversal
#bind h select-pane -L
#bind j select-pane -D
#bind k select-pane -U
#bind l select-pane -R
# A little faster pane resizing
#bind-key -n C-S-Up resize-pane -U 15
#bind-key -n C-S-Down resize-pane -D 15
#bind-key -n C-S-Left resize-pane -L 15
#bind-key -n C-S-Right resize-pane -R 15
# Helps to reorder the windows
bind-key S-Left swap-window -T -1
bind-key S-Right swap-window -T +1
# Navigator helper for last/next windows: not working as it should
# bind Right next-window
# bind Left previous-window
# Window with new name
bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'"
# reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# set to main-horizontal, 60% height for main pane
bind m set-window-option main-pane-height 60\; select-layout main-horizontal
# Start copy mode when scrolling up
#bind -n WheelUpPane copy-mode
set -g focus-events on
# List of plugins
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 'tmux-plugins/tmux-online-status'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-net-speed'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-pain-control'
#set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-sidebar'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-logging'
# Plugin configurations
set -g @resurrect-save-bash-history 'on'
set -g @resurrect-capture-pane-contents 'on'
# Restore additional programs
set -g @resurrect-processes 'ssh fish tail tailf grc watch atop htop'
set -g @continuum-restore 'on'
set -g @continuum-boot 'on'
set -g @resurrect-strategy-nvim 'session'
set -g @prefix_highlight_show_copy_mode 'on'
# Better colors for copy mode
set -g @prefix_highlight_copy_mode_attr 'fg=black,bg=yellow,bold'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'