-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.tmux.conf
118 lines (101 loc) · 3.36 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
# UTF-8
setw -gq utf8 on
# Give esc back
set -s escape-time 0
# Use Ctrl-S
unbind C-b
set -g prefix C-s
bind s send-prefix
# User keys
set -s user-keys[0] "\e\e[A" # iTerm ⌥↑
set -s user-keys[1] "\eb" # iTerm ⌥→
set -s user-keys[2] "\e\e[B" # iTerm ⌥↓
set -s user-keys[3] "\ef" # iTerm ⌥←
# Bind commands
bind - split-window -v
bind | split-window -h
bind l select-pane -R
bind k select-pane -U
bind j select-pane -D
bind h select-pane -L
bind x send-keys C-x
# Use Shift-arrow keys without prefix key to switch panes
bind -n S-Left select-pane -L
bind -n S-Right select-pane -R
bind -n S-Up select-pane -U
bind -n S-Down select-pane -D
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# Use Alt-arrow to switch windows
bind -n M-Left prev
bind -n User1 prev
bind -n M-Right next
bind -n User3 next
bind -n M-Up run-shell 'tmux choose-tree -wf"##{==:##{session_name},#{session_name}}"'
bind -n User0 run-shell 'tmux choose-tree -wf"##{==:##{session_name},#{session_name}}"'
bind C-n next
bind C-p prev
bind C-d detach
bind C-s last-window
bind K confirm-before kill-pane
bind A command-prompt "rename-window '%%'"
bind R source-file "$HOME/.tmux.conf" \; display "Configuration Reloaded!"
bind c if-shell "tmux -V | grep -q 1\\\\." \
"set-option default-path \"$PWD\" \; neww" \
"neww -c '#{pane_current_path}'"
bind C-c if-shell "tmux -V | grep -q 1\\\\." \
"set-option default-path \"$PWD\" \; neww" \
"neww -c '#{pane_current_path}'"
# base configuration
set -g base-index 1
set -g bell-action none
set -g default-terminal "screen-256color"
set -g history-limit 5000
set -g status-interval 3
setw -g automatic-rename on
setw -g monitor-activity on
set -g set-titles-string "#W #{session_alerts}"
# Configure tmux-prefix-highlight colors
set -g @prefix_highlight_empty_prompt ' ' # four spaces
set -g @prefix_highlight_output_prefix '('
set -g @prefix_highlight_output_suffix ')'
set -g @prefix_highlight_bg 'black'
set -g @prefix_highlight_fg '#eb0028'
# Configure Key-off mode
ICON_KEY_OFF="#([ $(tmux show-option -qv key-table) = 'off' ] && \
printf '#[fg=#eb0028]' || \
printf '#[fg=colour28]')\
・"
# Statusbar
set -g status-position top
set -gq status-style fg=magenta,bg=black,underscore
setw -gq status-fg magenta
setw -gq status-bg black
setw -gq status-attr underscore
if-shell "uname | grep -q FreeBSD" \
'set -g status-left "#[fg=#eb0028] "'
if-shell "uname | grep -q Linux" \
'set -g status-left "#[fg=#951c7a] "'
if-shell "uname | grep -q Darwin" \
'set -g status-left "#[fg=#ffffff] "'
setw -g automatic-rename on
setw -g window-status-separator ''
HOST_OR_COMMAND="#{?#{==:#T,},#W,#{?#{window_active},#[default]#[nounderscore]#[fg=brightyellow],#[default]}#T}"
STATUS_FORMAT="#I $HOST_OR_COMMAND"
setw -g window-status-format " $STATUS_FORMAT "
setw -g window-status-current-style fg=brightyellow
setw -g window-status-current-format '#[nounderscore]/'$STATUS_FORMAT'\'
set -g status-right " #{prefix_highlight}#[nounderscore]$ICON_KEY_OFF#[fg=yellow]%Y/%m/%d #[fg=magenta]%I:%M %p"
# Key table configuations
# Also, change some visual styles when window keys are off
bind -T root -n M-x \
set prefix None \;\
set key-table off \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off -n M-x \
set -u prefix \;\
set -u key-table \;\
refresh-client -S