-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
208 lines (178 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
206
207
208
#Justyn's tmux config
# Justyn Shull <justyns <at> justynshull.com>
#URL References I used to create this config:
# http://mutelight.org/articles/practical-tmux
# https://bbs.archlinux.org/viewtopic.php?id=84157
# http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/
# http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/
# http://cheasy.de/tmux.pdf
# http://www.edschmalzle.com/2010/09/29/getting-into-tmux/
# http://tonkersten.com/2011/07/104-switching-to-tmux/
# http://www.linuxized.com/2010/05/switching-from-gnu-screen-to-tmux/
# https://wiki.archlinux.org/index.php/Tmux
## Shortcuts to remember
# Ctrl+a is the 'prefix' / control key
# ctrl+a ? - displays all of the current key bindings
# ctrl+a ctrl+a - switches between last active window
# ctrl+a , - renames current window
# ctrl+a | - splits window vertically
# ctrl+a - - splits window horizontally
# ctrl+a q - displays numbers on each pane. Press the number to go to that pane
# ctrl+a o - cycle through panes
# ctrl+a ctrl+o - cycle panes into the pane you're currently viewing
# ctrl+a n,p - next/previous windows same as screen
# ctrl+a <space>- changes default layout of your panes (even-horiz, even-vert, etc)
# ctrl+a alt+arrowkeys - resizes current window pane in the direction of the arrow key
# ctrl+a [ - enter copy mode
# ctrl+a a <com>- sends <com> to nested screen or tmux session
# ctrl+a x - kill a pane(or window)
# ctrl+a w - list and switch between windows
# ctrl+a s - list and switch between sessions
# ctrl+a : new -s <session name> - create a new session
# ctrl+a r - reload / source .tmux.conf
# ctrl+a A - rename current window
# ctrl+a k - kill window
# ctrl+a m - turn on/off monitor_activity for a window(useful for irssi)
# ctrl+a M - turn on/off mouse mode
# ctrl+a b/B - switch prefix from ctrl+a to ctrl+b or back
# ctrl+a X - break pane to its own window
# ctrl+a j - bring a window in to current window as a pane (ie: join-pane 0:1)
# ctrl+a T <pos>- move current window to position <pos>
# ctrl+a+left - move current window one spot to the left
# ctrl+a+right - move current window one spot to the right
# ctrl+a u - copy the current window/pane and pipe it to urlview to grab all the urls
# ctrl+a z - Zoom into the current pane, press again to zoom back out (useful for copying text)
#
## Commands to remember
# :setw synchronize-panes [on|off] - Synchronize panes on the current window, sends input to all of them at the same time.
# :movew -r - Renumber (compact) all windows to fill in gaps. Can also use movew <num> to renumber the current window to <num>.
##Display##
# Set status bar
set -g status-fg white
set -g status-bg black
set-option -g status-justify left
set-option -g status-left-length 40
# Left Status
set -g status-left-bg black
set -g status-left-fg blue
set -g status-left '#[fg=red]#h#[fg=green]:#[fg=white]#S #[fg=green]][#[default]'
# Right status
set -g status-right-fg yellow
set -g status-right-bg black
#set -g status-right '%Y-%m-%d %H:%M[#(uptime | cut -d "," -f 3-)]'
#set -g status-right '#[fg=green]][ #[fg=cyan]%Y-%m-%d #[fg=yellow]#[fg=white] %H:%M#[default]'
# Highlight active window
set-window-option -g window-status-current-fg blue
set-window-option -g window-status-current-bg black
set-window-option -g window-status-current-attr bright
#
setw -g window-status-bg black
setw -g window-status-current-fg blue
setw -g window-status-alert-attr default
setw -g window-status-alert-fg yellow
#
set-window-option -g mode-fg white
set-window-option -g mode-bg red
set-window-option -g mode-attr bright
set-option -g message-fg white
set-option -g message-bg blue
# Active pane highlight
set-option -g pane-active-border-fg blue
set-option -g pane-active-border-bg white
set-option -g pane-border-fg white
set-option -g pane-border-bg black
# Set window notifications
setw -g monitor-activity on
setw -g visual-activity off
# Automatically set window title to command that is running
# setw -g automatic-rename
# Change binding to ctrl+a like screen
set-option -g prefix C-a
# Set tmux to vi mode keys for copy-mode
setw -g mode-keys vi
# Behave the same way as screen with nested multiplexers
# IE: C-a a <command> sends <command> to inner screen/tmux
bind-key a send-prefix
# Start Window Numbering at 1
set -g base-index 1
# 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
# no more delay bhetween ctrl+a and a sequence
set -s escape-time 0
# Fix problems with scrolling in some terminals
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# From http://tonkersten.com/2011/07/104-switching-to-tmux/
set-option -g history-limit 100000
#set-option -g pane-active-border-bg default
#set-option -g pane-active-border-fg red
#set-option -g pane-border-bg default
#set-option -g pane-border-fg cyan
#set-window-option -g window-status-format ' #I:#W '
#set-window-option -g window-status-current-format ' (#I:#W) '
set-window-option -g window-status-format '#I:#W#F'
set-window-option -g window-status-current-format '#I:#W#F'
# From http://dev.gentoo.org/~wired/conf/tmux.conf
set-option -g mouse-select-pane off
set-option -g status-utf8 on
setw -g mode-mouse off
set-option -g status-keys vi
set-option -g bell-action any
set-option -g set-titles on
set-option -g set-titles-string '#H:#S.#I.#P #W #T' # window number,program name,active (or not)
##Keybindings
# Change some keybindings to match screen and be easier to use
# Ctrl+a ctrl+a - switch to last active window
# ctrl+a | and - to split the window(horiz and vert)
bind-key C-a last-window
bind a send-prefix
unbind %
unbind-key \
bind | split-window -h
bind \ split-window -h
bind - split-window -v
bind C-c new-window
bind k confirm-before "kill-window"
bind C-k confirm-before "kill-window"
bind m setw monitor-activity
bind M setw -g mode-mouse
#bind s list-sessions
# Hide and show window name from status line
#bind '_' setw window-status-format '#I'\; setw window-status-current-format '#I'
#bind '+' setw window-status-format '#I:#W#F'\; setw window-status-current-format '#I:#W#F'
# Easy reloading of config file
bind r source-file ~/.tmux.conf
# Rename like in screen
bind A command-prompt "rename-window %%"
# Change prefix key from ctrl+a to ctrl+b and back
bind B set-option -g prefix C-a
bind b set-option -g prefix C-b
bind C-x set-option -g prefix C-x
# From https://bbs.archlinux.org/viewtopic.php?id=84157&p=5
# "Some guys in the irc liked a trick I use with tmux and urlview to grab/browse url's
# from terminal applications run in tmux (most use it with mutt),
# so I post it here too for reference ..."
bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlview" '$SHELL -c "urlview < /tmp/tmux-buffer"'
# From http://unix.stackexchange.com/questions/14300/tmux-move-window-to-pane
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
#bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
bind X break-pane
# kill K k
unbind K
bind K confirm-before "kill-window"
unbind k
bind k confirm-before "kill-window"
# windows ^W w
unbind ^W
bind ^W list-windows
unbind w
bind '"' list-windows
# From http://superuser.com/questions/343572/how-do-i-reorder-tmux-windows
# c-a T and then a number to move the current window to that position
# Similar to screen's :number
bind-key T command-prompt -p "move window to:" "swap-window -t '%%'"
# c-a-left arrow to move window left
# c-a-right arrow to move window right
bind-key -n C-a-Left swap-window -t -1
bind-key -n C-a-Right swap-window -t +1