forked from igorvisi/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
194 lines (147 loc) · 4.98 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
182
183
184
185
186
187
188
189
190
191
192
193
194
# Thanks to Nick Nisi for his talk (https://www.youtube.com/watch?v=5r6yzFEXajQ) and Ham Vocke (http://www.hamvocker.com) for his articles about tmux.
# automatically renumber tmux windows
set -g renumber-windows on
# enable mouse support for switching panes/windows
setw -g mouse on
# 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
# make window/pane index start with 1
set -g base-index 1
setw -g pane-base-index 1
set-option -g set-titles on
set-option -g set-titles-string "#T - #W"
# Loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none
# Keep the windows' name fixed after I rename it.
set-option -g allow-rename off
# make delay shorter
set -sg escape-time 0
#::::::::::::::::::::::::: KEYMAP CHANGES ::::::::::::::::::::::::::#
# Remap prefix from 'C-b' to '²'.
unbind C-b
set-option -g prefix ²
bind-key ² send-prefix
# Split panes using é and "
bind é split-window -h
unbind %
# for nested tmux sessions
bind-key a send-prefix
# Use Alt-arrow keys without prefix key to switch pane
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Shift + arrow keys to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# pane movement shortcuts
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Resize pane shortcuts
bind -r H resize-pane -L 10
bind -r J resize-pane -D 10
bind -r K resize-pane -U 10
bind -r L resize-pane -R 10
# Zoom pane
# zoom
unbind z
bind-key z \
new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' \;\
swap-pane -s tmux-zoom.1 \;\
select-window -t tmux-zoom
# unzoom
unbind Z
bind-key Z \
last-window \;\
swap-pane -s tmux-zoom.1 \;\
kill-window -t tmux-zoom
# synchronize all panes in a window
bind b setw synchronize-panes
# SSH connection
unbind S
bind-key S command-prompt "new-window -n %1 'ssh %1'"
# Reload conf without quit tmux session
unbind r
bind-key r source-file ~/.tmux.conf \; display-message "Source-file done"
# quickly open a new window
bind N new-window
# set vi mode for copy mode
setw -g mode-keys vi
# more settings to make copy-mode more vim-like
unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
# Vim style
bind-key -T copy-mode-vi 'v' send -X begin-selection
# Buffers from clipboard xclip must be installed
bind C-v run "xclip -o -sel clip | tmux load-buffer - ; tmux paste-buffer"
# tile windows¬
unbind =
bind = select-layout tiled
#::::::::::::::::::::::::: DESIGN CHANGES ::::::::::::::::::::::::::#
# Inspired from https://github.com/arcticicestudio/nord-tmux/
# Colors
set -g status-bg black
set -g status-fg white
set -g status-attr none
# Clock Mode
setw -g clock-mode-colour cyan
## Status bar design
# status line
# set -g status-utf8 on
set -g status-justify left
set -g status-bg default
set -g status-fg colour12
set -g status-interval 2
# pane
set -g pane-border-bg black
set -g pane-border-fg black
set -g pane-active-border-bg black
set -g pane-active-border-fg brightblack
set -g display-panes-colour black
set -g display-panes-active-colour brightblack
# messaging
set -g message-fg cyan
set -g message-bg brightblack
set -g message-command-fg cyan
set -g message-command-bg brightblack
# window mode
setw -g mode-bg colour6
setw -g mode-fg colour0
set -g default-terminal "screen-256color"
# Status
# Bars
set -g status-left-length 40
set -g status-right-length 60
set -g status-left "#[fg=brightblack,bold]#[fg=white,bg=brightblack,bold] #H on #[fg=yellow]#S #[fg=brightblack,bg=default,nobold,noitalics,nounderscore]"
set -g status-right "#[fg=brightblack,bg=default,bold,noitalics,nounderscore]"
# Windows
set -g window-status-format "#[fg=brightblack,bold]#[fg=white,bg=brightblack,bold]#I #W#[fg=brightblack,bg=default]"
set -g window-status-current-format "#[fg=colour012,bg=default,bold,noitalics,nounderscore]#[fg=white,bg=colour012,bold]#I #W#[fg=colour012,bg=default,bold,noitalics,nounderscore]"
set -g window-status-separator ""
#::::::::::::::::::::::::: PLUGINS ::::::::::::::::::::::::::#
# Auto install of Tmux Plugin Manager
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm'"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-yank'
# set -g @plugin 'igorvisi/tmux-cpu-ram-network'
# Initialize Tmux Plugin Manager
run '~/.tmux/plugins/tpm/tpm'
# plugins configuration
# enable continnum to restore the last saved environnement on start
set -g @continuum-restore 'on'