-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
201 lines (157 loc) · 6.24 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
#Starting by loading powerline stuff
#run "powerline-daemon -q"
#source "/usr/lib/python3.6/site-packages/powerline/bindings/tmux/powerline.conf"
# goto last used window
bind-key C-a last-window
# Nested Tmux Session
# send to tmux session within another tmux session; like screen
bind-key a send-prefix
# fix delay time between tmux & vim
set-option -sg escape-time 0
# default shell
set-option -g default-command /bin/zsh
set-option -g default-shell /bin/zsh
# reload config
bind-key r source-file ~/.tmux.conf \; display-message "Configuration reloaded"
# edit config
bind-key e new-window -n 'conf' '${EDITOR:-vim} ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display "~/.tmux.conf sourced"'
bind-key '/' new-window 'man tmux'
# clear screen and scrollback history
bind-key -n C-k send-keys C-l \; run 'tmux clear-history'
#unbind-key C-l
#bind-key -n C-k 'tmux clear-history'
# set display timelimit
set-option -g display-panes-time 2000
set-option -g display-time 1000
# history size
set-option -g history-limit 10000
# enable shell hotkeys C-left/C-right
# http://sigizmund.com/tmux-and-c-leftc-right/
set-window-option -g xterm-keys on
# enable 256 color terminal
# http://blog.sanctum.geek.nz/256-colour-terminals/
set-option -g default-terminal "screen-256color"
#set-option -g default-terminal "xterm-256color"
#}}}
#-------- Keybinding (Vim Style) {{{
#------------------------------------------------------
# vim keys in command prompt
set-option -g status-keys vi
# unicode
#set-window-option -g utf8 on
#throws error: unkown option utf8
# select panes
bind-key k select-pane -U
bind-key h select-pane -L
bind-key j select-pane -D
bind-key l select-pane -R
#select panes by number
#Result of bind-key q is pane numbers and from those
#you do
bind-key M-1 select-pane -t 1
bind-key M-2 select-pane -t 2
bind-key M-3 select-pane -t 3
bind-key M-4 select-pane -t 4
bind-key M-5 select-pane -t 5
bind-key M-6 select-pane -t 6
# cycle windows/panes (no prefix)
bind-key -n M-k select-pane -t :.- # prev pane
bind-key -n M-j select-pane -t :.+ # next pane
bind-key -n M-h select-window -t :- # previous window
bind-key -n M-l select-window -t :+ # next window
# resize panes
bind-key -r J resize-pane -D 1
bind-key -r K resize-pane -U 1
bind-key -r H resize-pane -L 1
bind-key -r L resize-pane -R 1
# better pane split bindings with current path (tmux 1.9+)
bind-key \ split-window -h -c "#{pane_current_path}" # vertical split
bind-key - split-window -v -c "#{pane_current_path}" # horizontal split
#full window split
bind-key | split-window -fh -c "#{pane_current_path}" # full window vertical split
bind-key _ split-window -fv -c "#{pane_current_path}" # full window horizontal split
# new window/pane with the current path (tmux 1.9+)
bind-key c new-window -c "#{pane_current_path}"
# kill window/pane without prompt
# http://unix.stackexchange.com/a/30283
bind-key & kill-window
bind-key x kill-pane
# sync panes; send what you are typing to other panes.
bind-key C-l set-window-option synchronize-panes
#}}}
#-------- Copy Mode (Vim Style) {{{
#------------------------------------------------------
# This section of hotkeys mainly work in copy mode and no where else
# vim keys in copy or choice mode
set-window-option -g mode-keys vi
# copying selection vim style
bind-key Enter copy-mode # enter copy mode; default [
bind-key -T copy-mode-vi Escape send-keys clear-selection # Clears selection
bind-key -T copy-mode-vi v send-keys -X begin-selection # begin visual mode
bind-key -T copy-mode-vi V send-keys -X select-line # visual line
bind-key -T copy-mode-vi y send-keys -X copy-selection # Yank to tmux clipboard
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle # visual block toggle
bind-key p paste-buffer # paste; default ]
bind-key P choose-buffer # choose which buffer to paste from
# }}}
#-------- Window / Pane Settings {{{
#------------------------------------------------------
# start window/pane index on 1 instead of 0
set-option -g base-index 1
set-window-option -g pane-base-index 1
# pane divider color; non active pane
set-option -g pane-border-fg white
set-option -g pane-border-bg black
# pane divider color; active pane
# helps when you have more than two panes.
set-option -g pane-active-border-fg red
set-option -g pane-active-border-bg black
# make the current window the first window
bind T swap-window -t 1
# swap windows/panes
bind-key -n M-Left swap-window -t -1
bind-key -n M-Right swap-window -t +1
# bind-key -n M-Up swap-pane -U
# bind-key -n M-Down swap-pane -D
# auto renumber windows sequentially
set-option -g renumber-windows on
#CENTER {{{
# Symbol Meaning ================================
# * Denotes the current window.
# - Marks the last window (previously selected).
# # Window is monitored and activity has been detected.
# ! A bell has occurred in the window.
# ~ The window has been silent for the monitor-silence interval.
# M The window contains the marked pane.
# Z The window's active pane is zoomed.
# monitor changes on non-focus window (activity symbol = #)
# (e.g 1:zsh 2:zsh 3:torr# 4:im- 5:chat# 6:fm# 7:conf*)
set-window-option -g monitor-activity on
# displays a message at the bottom when activity is detected (e.g Activity in Window 5)
# requires: monitor-activity on
# set-option -g visual-activity off
# bell colors (bell symbol = !)
# to simulate a bell alert use: sleep 3 && echo -e "\a"
set-window-option -g window-status-bell-style 'fg=black,bg=colour5,bright'
# statusbar colors
set-option -g status-fg white
set-option -g status-bg black
set-option -g status-attr default
# window title colors; non active
set-window-option -g window-status-fg cyan
set-window-option -g window-status-bg default
set-window-option -g window-status-attr dim
# window title colors; active
set-window-option -g window-status-current-fg white #font
set-window-option -g window-status-current-bg red #boarder
set-window-option -g window-status-current-attr bright
#}}}
# LEFT SIDE {{{
set-option -g status-justify centre
set-option -g status-left-length 40
set-option -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P"
#}}}
# RIGHT SIDE {{{
# use "man date" to set the clock to your liking
set-option -g status-right "#[fg=blue]#(hostname) | #[fg=cyan]%a %D %l:%M:%p"
#}}}