-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux20.conf
90 lines (81 loc) · 3.03 KB
/
.tmux20.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
# base settings
## allow utf8
set-window-option -g utf8 on
## disable ESC delay
set-option -s escape-time 0
## enable clipboard on MacOS X
## see. http://d.hatena.ne.jp/koseki2/20110816/TmuxCopy
#set-option -g default-command "reattach-to-user-namespace -l zsh"
# key mappings
## vi binding
set-window-option -g mode-keys vi
## set prefix (^T)
unbind-key C-b
set-option -g prefix C-t
bind-key a send-prefix
## last window (^t)
unbind ^A
bind ^t last-window
## reload config (r)
bind r source-file ~/.tmux.conf\; display-message "Reload Config!!"
## clear history
bind C-c run 'tmux capture-pane -S -10000; tmux save-buffer ~/.tmux/capture-$(date +%Y%m%d%H%M%S).log; tmux delete-buffer; tmux display-message "Capture saved"'
bind C-l clear-history\; display-message "Cleared history"
bind H pipe-pane\; display-message "Stopped logging"
bind h pipe-pane -o 'cat >> ~/.tmux/#S:#I.#P-$(date +%Y%m%d%H%M%S).log'\; display-message "Started logging"
## join-pane
bind j command-prompt "join-pane -t ':%%'"
## synchronize panes
set-option -g synchronize-panes off
bind e setw synchronize-panes on
bind E setw synchronize-panes off
## swap window
bind S command-prompt "swap-window -t '%%'"
## new session
bind N new-session
## refresh client
bind ^r refresh-client
## base index at 1
set-option -g base-index 1
set-option -g pane-base-index 1
# color settings
## enable 256 color
set-option -g default-terminal "screen-256color"
#set-option -g default-terminal "xterm"
## status line
set-option -g status-fg white
set-option -g status-bg colour234
## pane border
set-option -g pane-border-fg colour245
set-option -g pane-active-border-fg colour39
# status line
## reload every 1sec
set-option -g status-interval 1
## left
set-option -g status-left-length 32
set-option -g status-left '#[fg=cyan,bold] [#h:#S]#[default] |'
## main
set-window-option -g window-status-format " #I #W #F "
set-window-option -g window-status-current-format "#[fg=white,bg=colour237] #I #W #F "
## right
set-option -g status-right-length 150
set-option -g status-right '#(tmux show-options -g | grep mouse)#[default] | #[fg=magenta,bold]#(uptime | head -1 | sed -e "s/^.*load /load /g")#[default] | #[fg=blue,bold][%Y/%m/%d(%a) %H:%M:%S]#[default]'
## message
set-option -g message-attr bold
set-option -g message-fg white
set-option -g message-bg red
set-option -g history-limit 10000
set-window-option -g automatic-rename off
set-option -gw mouse off
bind-key m \
if-shell "tmux show-options -g | grep 'mouse off'" "set-option -g mouse-utf8 on" "set-option -g mouse-utf8 off" \;\
if-shell "sleep 1; tmux show-options -g | grep 'mouse off'" "set-option -g mouse on" "set-option -g mouse off"
# ssh environment
set -g update-environment "DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_AUTH_SOCK SSH_CLIENT SSH_CONNECTION WINDOWID XAUTHORITY"
#set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock
# 1.9 changed the behaviour of split-window and new-window.
# I prefer the old style for split-window.
unbind %
bind-key % split-window -h -c "#{pane_current_path}"
unbind '"'
bind-key '"' split-window -v -c "#{pane_current_path}"