-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
136 lines (110 loc) · 4.1 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
# vi: set ft=tmux :
### essential
# unbind-key -a
bind -n F5 source-file ~/.tmux.conf \; display-message "Config file has been reloaded"
### function
set -g default-command /bin/zsh
set -g status on
set -g status-interval 60
set -g renumber-windows on
set -g history-limit 999999999
set -gs escape-time 0
set -g mouse on
set -g detach-on-destroy off
set -ag update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION TYM_ID SSH_CLIENT"
# set -ag update-environment "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION TYM_ID"
# setenv -g SSH_AUTH_SOCK $SSH_AUTH_SOCK
# setenv -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock
if-shell "echo $TERM | grep 256color" 'set -g default-terminal xterm-256color'
if-shell "echo $TERM | grep 256color" 'set -g terminal-overrides ",xterm-256color:Tc"'
# set-option -g default-terminal "tmux-256color"
# set-option -ga terminal-overrides ",$TERM:Tc"
# set -g terminal-overrides 'xterm*:smcup@:rmcup@'
### hooks
set-hook -g session-created "run ~/dotfiles/bin/tmux-reorder-sessions.sh"
set-hook -g session-closed "run ~/dotfiles/bin/tmux-reorder-sessions.sh"
### status
set -g status-style 'bg=black,fg=white'
set -g status-position bottom
set -g status-justify 'centre'
set -g status-left-length 25
%if #{SSH_CONNECTION}
set -g status-left '#[fg=black,bg=green] # #S #[bg=default] '
%else
set -g status-left '#[fg=black,bg=white] # #S #[bg=default] '
%endif
set -g window-status-current-style 'fg=black,bg=blue'
set -g status-right-length 25
# set -g status-right '%Y/%m/%d(%a) %H:%M'
set -g status-right '#[fg=grey]#H '
set -g window-status-style 'bg=black,fg=white'
set -g window-status-format ' #I:#W '
set -g window-status-current-format ' #I:#W '
# message style
set -g message-style fg=yellow,bg=black
### key binds
unbind C-b
set -g prefix M-w
bind M-w send-prefix
bind -n M-v copy-mode \; display 'Entered Copy mode'
bind -n M-Space run 'tmux set-buffer "$(cb-paste)"; tmux paste-buffer'
bind -n M-T new-session
bind -n M-J switch-client -n
bind -n M-K switch-client -p
bind -n M-S-Down switch-client -n
bind -n M-S-Up switch-client -n
bind -n M-S-d detach
bind -n M-d kill-pane
bind -n M-D confirm kill-window
bind -n M-r command-prompt -p 'Rename Window: ' "rename-window '%%'"
bind -n M-R command-prompt -p 'Rename Session: ' "rename-session '%%'"
bind -n M-t new-window -c "#{pane_current_path}"
##* remapped by tym:
# <M-h> -> <M-Left>
# <M-l> -> <M-Right>
# <M-H> -> <M-S-Left>
# <M-L> -> <M-S-Right>
bind -n M-h prev
bind -n M-l next
bind -n M-Left prev
bind -n M-Right next
bind -n M-h prev
bind -n M-l next
bind -n M-H swap-window -t -1\; prev
bind -n M-L swap-window -t +1\; next
bind -n M-S-Left swap-window -t -1\; prev
bind -n M-S-Right swap-window -t +1\; next
bind -n M-i split-window -h\; select-layout even-horizontal
bind -n M-- split-window -v\; select-layout even-vertical
bind -n M-n select-pane -R
bind -n M-p select-pane -L
bind -r l select-pane -R
bind -r h select-pane -L
bind -r j select-pane -D
bind -r k select-pane -U
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
bind -r i select-layout even-horizontal
bind -r - select-layout even-vertical
### mouse
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
### copy mode
# old style
# bind -t vi-copy v begin-selection
setw -g mode-keys vi
unbind -T copy-mode-vi MouseDragEnd1Pane
bind -T copy-mode-vi MouseDown1Pane send -X cancel
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi Enter send -X begin-selection
bind -T copy-mode-vi Escape send -X clear-selection
bind -T copy-mode-vi C-c send -X cancel
bind -T copy-mode-vi Enter send -X copy-pipe-and-cancel '~/.bin/cb-copy'
bind -T copy-mode-vi y send -X copy-pipe-and-cancel '~/.bin/cb-copy'
bind -T copy-mode-vi Y send -X copy-line
bind -T copy-mode-vi H send -X start-of-line
bind -T copy-mode-vi L send -X end-of-line
bind -T copy-mode-vi K send -X page-up
bind -T copy-mode-vi J send -X page-down