-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
218 lines (211 loc) · 6.58 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
206
207
208
209
210
211
212
213
214
215
216
217
#
# status & style options
# --------------
#
# show-options
# show-window-options
#
# message bar
# -----------
#
# message-style
# message-command-style
#
#
# status bar
# ----------
#
# status [on | off]
# status-position [top | bottom]
# status-interval interval - how long between status updates (default 15)
#
# status-style (set the style for the entire status bar)
# status-justify [left | centre | right] (where should the window list be)
#
# status-left string
# status-left-length (default 10)
# status-left-style
#
# status-right string
# status-right-length (default 40)
# status-right-style
#
#
# windows
# -------
#
# window-active-style style
#
# window-status-activity-style style
# window-status-bell-style style
#
# window-status-current-format string
# window-status-current-style style
#
# window-status-format string (default #I:#W#F)
#
# window-status-last-style style
#
# window-status-separator string (default single-space)
#
# window-status-style style - specify the style for all windows in the status line
# window-style style - specify the default window style
#
#
# renumber-windows [on | off]
# see: set-window-option
#
#
# pane
# ----
#
# main-pane-height height
# main-pane-width width
#
# other-pane-height height
# other-pane-width width
#
# pane-active-border-style style
# pane-border-format format (pane border status lines)
# pane-border-status [off | top | bottom]
# pane-border-style style
#
# pane-base-index index - starting index for pane numbering
#
# synchronize-panes [on | off] - duplicate input to all panes in this window not in special mode
#
#
# clock
# -----
#
# clock-mode [-t target-pane] - display a large clock (command, not option)
#
# clock-mode-colour colour
# clock-mode-style [12 | 24]
#
#
#
#
#
#
#
#
# style
# Set status line message command style, where style is a comma-separated list
# of characteristics to be specified.
#
# These may be ‘bg=colour’ to set the background colour, ‘fg=colour’ to set the
# foreground colour, and a list of attributes as specified below.
#
# The colour is one of: black, red, green, yellow, blue, magenta, cyan, white,
# aixterm bright variants (if supported: brightred, brightgreen, and so on),
# colour0 to colour255 from the 256-colour set, default, or a hexadecimal RGB
# string such as ‘#ffffff’, which chooses the closest match from the default
#
#
#
#
#
#
# string
#
# Display string (by default the session name) to the left of the status line.
# string will be passed through strftime(3) and formats (see FORMATS) will be
# expanded. It may also contain the special character sequence #[] to change
# the colour or attributes, for example ‘#[fg=red,bright]’ to set a bright red
# foreground. See the message-command-style option for a description of colours
# and attributes.
#
# For details on how the names and titles can be set see the NAMES AND TITLES
# section.
#
# Examples are:
#
# #(sysctl vm.loadavg)
# #[fg=yellow,bold]#(apm -l)%%#[default] [#S]
#
# The default is ‘[#S] ’.
#
#
#
# %if #{==:#{host},myhost}
# set -g status-style bg=red
# %endif
#
#
# NAMES AND TITLES
# sessions and windows have names
# panes have titles - set by the program running in the pane, window inherits active pane title
#
#
# See also FORMATS
#
# Pre-existing formatting
#
# window-status-current-format "#I:#W#{?window_flags,#{window_flags}, }"
# window-status-format "#I:#W#{?window_flags,#{window_flags}, }"
# pane-border-format "#{?pane_active,#[reverse],}#{pane_index}#[default] \"#{pane_title}\""
# automatic-rename-format "#{?pane_in_mode,[tmux],#{pane_current_command}}#{?pane_dead,[dead],}"
#
# status-left "[#S] "
# status-left-length 10
#
# status-right " \"#{=21:pane_title}\" %H:%M %d-%b-%y"
# status-right-style fg=brightgreen,bg=black
#
# handy commands:
#
# C-b : - command mode, command mode commands prefixed with :
# : show-options -g - display current set options
# : show-window-options -g - display current window options
# C-b c - create window (virtual desktop)
# C-b number - switch window
# C-b % - create pane with vertical split (tmux horizontal)
# C-b " - create pane with horizontal split (tmux vertical)
# C-b arrow - switch panes (repeat turned off)
# C-b C-arrow - resize 1 at a time (repeat on, keep resizing without prefix)
# C-b M-arrow - resize 5 at a time (repeat on, keep resizing without prefix)
# C-b , - rename current window
# C-b ? - list all key bindings
# C-b q - display pane indexes
# C-b t - show time
# C-b x - kill current pane
# C-b z - zoom
# C-b [ - enter copy mode for scrolling
# space - start copy selection
# arrows - adjust selection
# enter - copy
# C-b ] - paste
#
# you can also do commands within a tmux pane via tmux
# tmux pipe-pane -o 'cat >>~/output.#I-#P' - output a pane to a file
# tmux set-option -g status-style $ENV_TMUX_COLOR - change the status w/ shell variable
set-option -g mouse on # allow mouse control - pane/window select, scroll, resize - to right-click paste hold shift
set-option -g status-right "%a %m/%d/%Y %I:%M%p" # set up date/clock day month/date/year hour:minute a/pm
set-option -g status-right-style bg=black,fg=brightgreen # set the clock to green on black
set-option -g window-status-current-style bg="#c0c0c0",fg=black # highlight current window
set-option -g history-limit 100000
# better key bindings for splits - including full splits, same path
bind-key \\ split-window -h -c "#{pane_current_path}"
bind-key - split-window -v -c "#{pane_current_path}"
bind-key | split-window -h -f -c "#{pane_current_path}"
bind-key _ split-window -v -f -c "#{pane_current_path}"
# open windows in same directory
bind-key c new-window -c "#{pane_current_path}"
# start windows/panes at 1 instead of 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# rebind arrow keys to remove repeat key timings
unbind-key Up
unbind-key Down
unbind-key Left
unbind-key Right
bind-key Up select-pane -U
bind-key Down select-pane -D
bind-key Left select-pane -L
bind-key Right select-pane -R
# set the status color based on the environment variable
# must do this via shell as status-style doesn't expand env vars
run-shell 'tmux set-option -g status-style "$ENV_TMUX_COLOR"'