-
Notifications
You must be signed in to change notification settings - Fork 21
/
tmux.conf
181 lines (131 loc) · 5.22 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
# ------------------------------------------------------------------------------
# FILE: .tmux.conf
# DESCRIPTION: tmux configuration file.
# AUTHOR: Sorin Ionescu <[email protected]>
# VERSION: 1.0.2
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# General Options
# ------------------------------------------------------------------------------
# Inform programs of 256 colour support.
set-option -g default-terminal "screen-256color-bce"
# Open new windows with Mac OS X pasteboard support.
set-option -g default-command "reattach-to-user-namespace -l zsh"
# Enable mouse.
set-window-option -g mode-mouse on
# List activity on all windows.
set-option -g bell-action any
# Set window notifications.
set-window-option -g monitor-activity on
set-option -g visual-activity on
# Scroll back buffer n lines.
set-option -g history-limit 10000
# Enable terminal window titles.
set-option -g set-titles on
# Automatically rename terminal title.
set-window-option -g automatic-rename on
# Set terminal title format (uses status bar variables).
set-option -g set-titles-string "tmux.#I.#W"
# Start window indexing at one instead of zero.
set-option -g base-index 1
set-window-option -g pane-base-index 1
# ------------------------------------------------------------------------------
# General Key Bindings
# ------------------------------------------------------------------------------
# Prefix = C-\
unbind-key 'C-b'
set-option -g prefix 'C-\'
bind-key 'C-\' send-prefix
# Set key map for copy and choice modes.
set-window-option -g mode-keys vi
unbind-key '['
unbind-key ']'
unbind-key -t vi-copy 'Space'
unbind-key -t vi-copy 'Enter'
bind-key Escape copy-mode
# Vim-like 'v' and 'y' in copy-mode.
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
# Vim-like 'p' paste.
bind-key 'p' paste-buffer
# Move the Mac OS X clipboard into tmux paste buffer.
bind-key 'P' run-shell "tmux set-buffer \"$(pbpaste)\"; tmux paste-buffer"
# Move tmux copy buffer into the Mac OS X clipboard.
bind-key 'Y' run-shell 'tmux show-buffer | pbcopy'
# Confirm before killing pane.
bind-key 'k' confirm-before kill-pane
# Toggle status bar.
bind-key 'b' set-option status
# Meta + Left/Right cycles through windows.
bind-key -n 'M-right' next-window
bind-key -n 'M-left' previous-window
# Commands
bind-key 'C' command-prompt "new-window %%"
bind-key '"' command-prompt "rename-window %%"
bind-key 'm' command-prompt "split-window 'exec man %%'"
bind-key 'h' split-window "exec man tmux"
# ------------------------------------------------------------------------------
# Status Bar
# ------------------------------------------------------------------------------
# Use UTF-8 in status bar.
set-option -g status-utf8 on
# Use key map for the status bar.
set-option -g status-keys vi
# The position of the window list (left, centre, or right).
set-option -g status-justify centre
# Update the status bar every n seconds.
set-option -g status-interval 5
# The maximum length of the left component of the status bar.
set-option -g status-left-length 20
# The maximum length of the right component of the status bar.
set-option -g status-right-length 20
# Status bar format.
set-option -g status-left ''
set-option -g status-right '#[fg=green] ###S#[default]'
# On-screen time for display-panes in ms.
set-option -g display-time 2000
# Default status bar colours.
set-option -g status-fg white
set-option -g status-bg black
set-option -g status-attr bright
# Default window title colours.
set-window-option -g window-status-fg white
set-window-option -g window-status-bg default
set-window-option -g window-status-attr dim
# Active window title colours.
set-window-option -g window-status-current-fg green
set-window-option -g window-status-current-bg default
set-window-option -g window-status-current-attr bright
# Command/message line colours.
set-option -g message-fg white
set-option -g message-bg black
set-option -g message-attr bright
# ------------------------------------------------------------------------------
# Panes
# ------------------------------------------------------------------------------
set-option -g display-panes-time 2000
# Pane borders.
set-option -g pane-border-fg white
set-option -g pane-active-border-fg blue
# Splitting panes.
bind-key '-' split-window -v
bind-key '|' split-window -h
# Moving between panes.
bind-key -n 'C-h' select-pane -L
bind-key -n 'C-j' select-pane -D
bind-key -n 'C-k' select-pane -U
bind-key -n 'C-l' select-pane -R
# Resizing panes.
bind-key -n 'S-Down' resize-pane -D 1
bind-key -n 'S-Up' resize-pane -U 1
bind-key -n 'S-Left' resize-pane -L 1
bind-key -n 'S-Right' resize-pane -R 1
# ------------------------------------------------------------------------------
# Clock
# ------------------------------------------------------------------------------
set-window-option -g clock-mode-colour cyan
set-window-option -g clock-mode-style 24
# ------------------------------------------------------------------------------
# Resources
# ------------------------------------------------------------------------------
bind-key r source-file ~/.tmux.conf; display-message "tmux.conf is reloaded"