-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
182 lines (138 loc) · 5.59 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
# vim: foldmethod=marker:foldlevel=0
# sources
# - http://spin.atomicobject.com/2012/01/28/less-perplexing-terminal-multiplexing-with-tmux/
# - https://bitbucket.org/jasonwryan/centurion/src/2c63835765d1/.tmux/?at=default
# set the Ctrl+a as the PREFIX key
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# if run as "tmux attach", create a session if one does not already exist
#new-session -n $HOST
# Start window numbering at 1, instead of at 0
set -g base-index 1
# Allows for faster key repetition
set -s escape-time 0
# shell, set the command for new windows and new logins (in tmux)
set -g default-command /bin/bash
set -g default-shell /bin/bash
# set the history for scrolling
set -g history-limit 9999
# confirm before killing a pane or the session
bind-key k confirm kill-pane
bind-key K confirm kill-session
## Status bar customization
set -g status-fg colour231
set -g status-bg colour234
set -g status-left-length 40
set -g status-left '#[bg=colour241,fg=colour114,bold]#(whoami)@#(hostname -s) #(curl -s checkip.dyndns.org | grep -Eo "[0-9\.]+") #[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour234,nobold]'
set -g status-right-length 150
set -g status-right '#(eval ~/.dotfiles/tmux/tmux-airline `tmux display -p "#{client_width}"`)'
set -g window-status-format "#[fg=colour244,bg=colour234]#I #[fg=colour240] #[default]#W "
set -g window-status-current-format "#[fg=colour234,bg=colour31]#[fg=colour117,bg=colour31] #I #[fg=colour231,bold]#W #[fg=colour31,bg=colour234,nobold]"
set-window-option -g window-status-fg colour249
set-window-option -g window-status-activity-attr none
set-window-option -g window-status-bell-attr none
set-window-option -g window-status-activity-fg yellow
set-window-option -g window-status-bell-fg red
# WINDOWS {{{
# listen to alerts from all windows
set -g bell-action any
# Don't automatically rename windows
set-window-option -g automatic-rename off
#window mode
setw -g mode-bg colour6
setw -g mode-fg colour0
# Highlight active window
set-window-option -g window-status-current-bg red
setw -g window-status-current-format "|#I:#W|"
# window status
#setw -g window-status-format " #F#I:#W#F "
#setw -g window-status-current-format " #F#I:#W#F "
setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W "
setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W "
setw -g window-status-current-bg colour0
setw -g window-status-current-fg colour11
setw -g window-status-current-attr dim
setw -g window-status-bg green
setw -g window-status-fg black
setw -g window-status-attr reverse
setw -g window-status-content-bg colour0
setw -g window-status-content-fg colour11
setw -g window-status-content-attr bold,blink,reverse
# 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
# alt+left/right cycles thru windows
bind-key -n M-right next
bind-key -n M-left prev
#}}}
# PANES {{{
#}}}
# messaging
set -g message-fg black
set -g message-bg yellow
set -g message-command-fg blue
set -g message-command-bg black
# Reload the config with PREFIX r
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
bind e neww "vim ~/.tmux.conf"
# BINDINGS {{{
# more intuitive keybindings for splitting
unbind %
bind - split-window -v
unbind '"'
bind | split-window -h
# create system logging pane with alt-L, exit (and close pane) with C-c
# split pane 1 horizontally
bind-key C-l split-window -p 40 -c "/home/paul/Developer/socsoc/app/tmp/logs" 'exec tail -f *.log /etc/apache2/*error.log'
bind-key C-b split-window -p 40 -c "/home/paul/Developer/socsoc/app/tmp/logs" 'exec bash'
bind-key C-t split-window -p 40 -c "/home/paul/Developer/socsoc/app/" 'Console/cake test app all ; read test'
# vim style window switching
bind -n C-l next
bind -n C-h pev
#}}}
# I'm a Vim user, this makes navigation easier
setw -g mode-keys vi # I especially like being able to search with /,? when in copy-mode
# copy / buffers
bind Escape copy-mode
unbind p
bind p paste-buffer
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
# copy tmux buffer to clipboard
bind C-y run "tmux show-buffer | xsel -b"
# move x clipboard into tmux paste buffer
bind C-p run "tmux set-buffer \"$(xsel -o)\"; tmux paste-buffer"
# quick view of processes
bind '~' split-window "exec htop"
# open {tmux,vim} man page
bind-key T neww -n "Tmux manual" "exec man tmux"
bind-key V neww -n "Vim manual" "exec vim -c 'h user-manual|only'"
bind-key R neww -n "Eigen manual" "exec less ~/.tmux/readme"
# open %% man page
bind C-m command-prompt -p "Open man page for:" "new-window 'exec man %%'"
# Just click it
set-option -g mouse-select-pane on
set-option -g mouse-select-window on
set-option -g mouse-resize-pane on
# set the border for the active pane
set -g pane-active-border-fg brightred
# Scroll your way into copy mode (scrollback buffer)
# and select text for copying with the mouse
setw -g mode-mouse on
# I like to give my windows descriptive names
set-window-option -g automatic-rename off
# I like to give my windows descriptive names
set-window-option -g automatic-rename off
# initialize sessions
#bind c source-file ~/.tmux/cakephp
#bind l source-file ~/.tmux/logging
# TERMINAL {{{
# Set the correct term (for displaying colors and the like)
set -g default-terminal "xterm-256color"
# Allow terminal scrolling
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# display errors for longer dan 750ms (=default)
set -g display-time 1000
#}}}