-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
181 lines (147 loc) · 5.59 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
174
175
176
177
178
179
180
181
# S.R TMUX conf
# set = set option
# setw = set window option
# bind -r = allow recursive press after prefix
# Plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'srathbone/tmux-online-status'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
# Enable true colours
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# Colour scheme
## Arc
# colour_process='#888888'
# colour_primary_text='#ffffff'
# colour_secondary_text='#eeeeee'
# colour_clock_text='#000000'
# colour_clock='#78af8f'
# colour_status_bar='#343843'
# colour_border_inactive='#343843'
# colour_border_active='#5294e2'
# colour_tab_activity='#cc575d'
# colour_tab_activity_text='#111111'
# colour_tab_active='#5294e2'
## Low contrast
colour_process='#6c6c6c'
colour_primary_text='#cccccc'
colour_secondary_text='#cccccc'
colour_clock_text='#000000'
colour_clock='#87af5f'
colour_status_bar='#303030'
colour_border_inactive='#303030'
colour_border_active='#5294e2'
colour_tab_activity='#c17979'
colour_tab_activity_text='#222222'
colour_tab_active='#799dc1'
colour_tab_active_text='#222222'
# Increase repeat-time
set -g repeat-time 2000
# Increase display-time
set -g display-time 3000
# Enable focus events
set -g focus-events on
# No automatic rename with zsh
set -g allow-rename off
set -g set-titles on
set -g set-titles-string "#T"
# scroll-back history
set -g history-limit 50000
# set delay
set -sg escape-time 0
# Set the base index for windows to 1 instead of 0
set -g base-index 1
# Set the base index for panes to 1 instead of 0
setw -g pane-base-index 1
# Renumber windows on close
set -g renumber-windows on
# Enable mouse support
set -g mouse on
# Refresh status bar every x seconds
set -g status-interval 5
# Set activity alert
setw -g monitor-activity on
set -g visual-activity on
# Plugins
## Online status
set -g @online_icon "#[fg=#73d216]✔"
set -g @offline_icon "#[fg=#fc4138]✘"
## Prefix indicator
set -g @prefix_highlight_bg "$colour_tab_active"
set -g @prefix_highlight_fg "$colour_tab_active_text bold"
# vim keys for navigation
setw -g mode-keys vi
# emacs keys for status line (prefix + :)
set -g status-keys emacs
# Set aggressive resize
setw -g aggressive-resize on
# Change prefix
set -g prefix C-a
unbind C-b
# Pressing the prefix twice sends the prefix to the underlying application
bind C-a send-prefix
# Bindings
# Send keys to all panes in a window
bind o setw synchronize-panes
# Reload conf with prefix + r
bind r source-file ~/.tmux.conf\; display "Conf Reloaded."
# Logging shortcut
bind P pipe-pane -o "cat >>$HOME/tmux.log" \; display "Toggled logging to ~/tmux.log"
# x clipboard support
#bind -T copy-mode-vi y copy-pipe "xsel -i -p -b"
bind -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "xsel -i -p -b"
bind p run "xsel -o -b | tmux load-buffer - ; tmux paste-buffer"
bind -T copy-mode-vi 'v' send -X begin-selection
bind -T copy-mode-vi 'C-v' send -X rectangle-toggle
# splitting panes
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# new window with current dir
bind c new-window -c "#{pane_current_path}"
# Goto last window
bind "a" last-window
# Maximize and minimize pane support
# Needs POSIX?
unbind Up
bind Up if-shell '[ "$(tmux list-panes | wc -l)" -gt 1 ]' 'new-window -d -n tmp; swap-pane -s tmp.1; select-window -t tmp' 'display "Only 1 pane open"'
unbind Down
bind Down if-shell '[ "$(tmux list-panes | wc -l)" -eq 1 -a "$(tmux list-windows | grep -q "tmp"; echo $?)" -eq 0 ]' 'last-window; swap-pane -s tmp.1; kill-window -t tmp' 'display "Multiple panes or no tmp window"'
# moving between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# moving between windows
bind -r H previous-window
bind -r L next-window
bind -r C-p previous-window
bind -r C-n next-window
# Resize panes
bind -r C-h resize-pane -L 5
bind -r C-j resize-pane -D 5
bind -r C-k resize-pane -U 5
bind -r C-l resize-pane -R 5
# Theme
## Status
set -g status-left ""
### Fancy Font
set -g status-right "#{prefix_highlight} #[fg=$colour_process]#{pane_current_command}#[fg=$colour_primary_text] #S:#I.#P #($HOME/.config/tmux/uptime.sh) #{online_status}#[fg=$colour_primary_text] #($HOME/.config/tmux/cpu-load.sh) #[fg=$colour_primary_text] #($HOME/.config/tmux/mem-usage.sh) #[fg=$colour_clock_text bg=$colour_clock] %H:%M "
# setw -g pane-border-status bottom
# setw -g pane-border-format ' #{pane_current_command} '
### For none fancy font replace icons with text or colour each segment differently
set -g status-right-length 70
set -g status-justify left
set -g status-style "fg=$colour_primary_text bg=$colour_status_bar"
## Panes
set -g pane-border-style "fg=$colour_border_inactive bg=default"
set -g pane-active-border-style "fg=$colour_border_active bg=default"
## Window
setw -g window-status-format "#[fg=$colour_secondary_text bg=$colour_status_bar]#{?window_activity_flag,#[fg=$colour_tab_activity_text bg=$colour_tab_activity],} #I #W #{?window_bell_flag,,}#{?window_content_flag,,}#{?window_silence_flag,,}#{?window_last_flag,,}"
setw -g window-status-current-format "#[bg=$colour_tab_active fg=$colour_tab_active_text bold] #I #W "
setw -g window-status-bell-style "fg=$colour_tab_activity_text bg=$colour_tab_activity bold"
setw -g window-status-activity-style "fg=$colour_tab_activity_text bg=$colour_tab_activity bold"
set -g window-status-separator '' # Remove space between windows in status bar
## Messaging
set -g message-style "fg=$colour_primary_text bg=$colour_status_bar bright"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.config/tmux/plugins/tpm/tpm'