-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.tmux.conf
205 lines (182 loc) · 7.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# tmux Config file
# NOTE: to use this config, you must install these prerequisites
#
# 1. install tmux (via homebrew or github.com/pataraco/dot_files/setup.sh)
# $ brew install tmux
# 2. install tmux plugin magager (tpm)
# $ git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm
# 3. install tmux-yank; Copy/paste (allows copy to clipboard)
# $ brew install reattach-to-user-namespace
# 4. iTerm2 (Mac) change setting of [option] key
# Preferences > Profiles > Keys > Left [Opt] key > "Esc+"
# 5. upgrade tmux
# repeat step 1
# start base at 1
set -g base-index 1
set -g pane-base-index 1
# aliases #
# bind bind-key
# set set-option
# setw set-window-option
### remap prefix from 'C-b' to 'C-a'
set -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
# add <Ctrl-\> as a secondary prefix key
set -g prefix2 'C-\'
bind 'C-\' send-prefix -2
# remap c to create and name a new window
#bind c command-prompt -p "window name?" "new-window; rename-window '%%'"
bind c new-window \; \
command-prompt -p "new window name?" "rename-window '%%'" \; \
split-window -h \; split-window -h \; split-window -h \; \
select-layout main-horizontal
# split panes using v and s
# bind v split-window -h
# bind s split-window -v
# split panes using |(\) and -
bind | split-window -h
bind \\ split-window -h
bind - split-window -v
# get rid of % and " bindings
# unbind %
# unbind '"'
# split into 4 panes
bind s split-window -h \; split-window -h \; split-window -h \; \
select-layout main-horizontal
# split panes using v and s
bind v select-layout even-horizontal
bind H select-layout main-horizontal
bind t select-layout tiled
bind h select-layout even-vertical
bind V select-layout main-vertical
set -g main-pane-height 30
set -g main-pane-width 100
set -g other-pane-height 20
set -g other-pane-width 80
# since we're replacing s (choose-tree) above, set it to t
bind g choose-tree
# since we're replacing t (clock-mode) above, set it to m
bind m clock-mode
# Automatically set window title
setw -g automatic-rename on
# don't rename windows automatically
# set -g allow-rename off
set -g set-titles on
set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
setw -g mode-keys vi
#setw -g mode-mouse on # version 1.9
set-option -g -q mouse on # version 2.1+
setw -g monitor-activity on
# Selecting panes
# Use Alt-Vim keys without prefix key to switch panes
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# Vim style pane selection (just use ALT)
# bind h select-pane -L
# bind j select-pane -D
# bind k select-pane -U
# bind l select-pane -R
# Use Alt-arrow keys without prefix key to switch panes
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
# Use Alt-Shift-Vim keys without prefix key to resize windows
bind -n M-H resize-pane -L
bind -n M-J resize-pane -D
bind -n M-K resize-pane -U
bind -n M-L resize-pane -R
### Use Shift-Vim keys to resize panes in steps of 5 using prefix key
##bind J resize-pane -D 5
##bind K resize-pane -U 5
##bind H resize-pane -L 5
##bind L resize-pane -R 5
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# No delay for escape key press
set -sg escape-time 0
# easily reload tmux config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
# THEME
####################################################
# NOTE: you CAN uncomment these to actually "see" the colors
# colour0 colour1 colour2 colour3 colour4 colour5 colour6 colour7 colour8 colour9
# colour10 colour11 colour12 colour13 colour14 colour15 colour16 colour17 colour18 colour19
# colour20 colour21 colour22 colour23 colour24 colour25 colour26 colour27 colour28 colour29
# colour30 colour31 colour32 colour33 colour34 colour35 colour36 colour37 colour38 colour39
# colour40 colour41 colour42 colour43 colour44 colour45 colour46 colour47 colour48 colour49
# colour50 colour51 colour52 colour53 colour54 colour55 colour56 colour57 colour58 colour59
# colour60 colour61 colour62 colour63 colour64 colour65 colour66 colour67 colour68 colour69
# colour70 colour71 colour72 colour73 colour74 colour75 colour76 colour77 colour78 colour79
# colour80 colour81 colour82 colour83 colour84 colour85 colour86 colour87 colour88 colour89
# colour90 colour91 colour92 colour93 colour94 colour95 colour96 colour97 colour98 colour99
# colour100 colour101 colour102 colour103 colour104 colour105 colour106 colour107 colour108 colour109
####### Syntax
# set -g STYLE bg=BG_COLOR,fg=FG_COLOR,COMMA_SEPARATED_LIST_OF_ATTRIBUTES
####### All styles
### message-command-style style
set -g message-command-style bg=colour1,fg=black # when ???
### message-style style
set -g message-style bg=white,fg=black # when entering commands
# set -g message-style bg=black,fg=brightred # black,orange
### mode-style style
set -g mode-style bg=white,fg=black # when in selection mode
### pane-active-border-style style
set -g pane-active-border-style bg=black,fg=green
### pane-border-style style
set -g pane-border-style bg=black,fg=red
set -g pane-border-format " (#P) #{?pane_active,#[align=centre] #W #[fg=colour54]#[align=right][#(pbpaste|cut -c-25|sed -E $'s/^[\t ]*//g')],}"
set -g pane-border-status top
### status line settings
set -g status-interval 1
### status-left 'string' # display string to the left of the status line (default: '[#S] ')
set -g status-left '#[bg=#191970]#[fg=colour82](#S) #[fg=colour87]#(whoami) #[default] #[bg=black] '
set -g status-left-length 40
set -g status-left-style bg=colour4,fg=colour1 # left part of status line (DOA)
#set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'
set -g status-right '#[bg=#191970]#[fg=#00BFFF]#(uptime|sed s/averages:/@/|cut -d'@' -f2) #[fg=#00FF00]%d-%b-%Y #[fg=#7CFC00]%H:%M #[fg=#ADFF2F][#{version}]#[default]'
set -g status-right-length 50
set -g status-right-style bg=colour4,fg=colour1 # right part of status line (DOA)
set -g status-style bg=colour27,fg=black # main/default style for status line
### window-active-style style
set -g window-active-style bg=black
### window-status-activity-style style
### window-status-bell-style style
### window-status-current-style style
set -g window-status-style bg=colour19,fg=colour15
set -g window-status-current-style bg=colour47,fg=colour17
set -g window-status-last-style bg=colour21,fg=colour15
set -g window-status-current-format ' (#W) ' # string format of non-active windows
set -g window-status-format ' [#W] ' # string format of non-active windows
set -g window-status-separator '#[bg=black]#[fg=green]|'
### window-style style
set -g window-style bg='#000125'
# set -g window-style fg=red,bg=colour7
set -g clock-mode-style 24
# # pane number display
# set -g display-panes-active-colour blue #blue
# set -g display-panes-colour brightred #orange
####################################################
# set inactive/active window styles (works > 2.0)
# default statusbar colors
# List of plugins
# install tmux pulgin magager (tpm)
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
set -g @plugin 'tmux-plugins/tpm'
#set -g @plugin 'tmux-plugins/tmux-sensible'
#set -g @plugin 'tmux-plugins/tmux-pain-control'
#set -g @plugin 'jimeh/tmux-themepack'
# Copy/paste (allows copy to clipboard)
# brew install reattach-to-user-namespace
# install tmux-yank
set -g @plugin 'tmux-plugins/tmux-yank'
set -g default-command "reattach-to-user-namespace -l ${SHELL}"
bind ] run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'