-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
112 lines (88 loc) · 4.25 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
run-shell 'tmux setenv -g TMUX_VERSION $(tmux -V | cut -d" " -f2 | cut -d- -f1)'
run-shell 'tmux setenv -g TMUX_VERSION_MAJOR $(tmux -V | cut -d" " -f2 | cut -d- -f1 | cut -d. -f1)'
run-shell 'tmux setenv -g TMUX_VERSION_MINOR $(tmux -V | cut -d" " -f2 | cut -d- -f1 | cut -d. -f2 | tr -d "[a-zA-Z]")'
set-window-option -g mode-keys vi
# Fix colored prompt
set -g default-terminal "screen-256color"
#setw -g mode-mouse on
#set -g mouse-select-pane on
#set -g mouse-select-window on
#set -g mouse-resize-pane on
# Allow xterm titles in terminal window, terminal scrolling with scrollbar, and setting overrides of C-Up, C-Down, C-Left, C-Right
#set -g terminal-overrides "xterm*:XT:smcup@:rmcup@:kUP5=\eOA:kDN5=\eOB:kLFT5=\eOD:kRIT5=\eOC"
# Scroll History
set -g history-limit 300000
# Set ability to capture on start and restore on exit window data when running an application
setw -g alternate-screen on
# Renumber windows sequentially after closing any of them
# supported on tmux >= 1.7
if-shell '[ "$TMUX_VERSION_MAJOR" -eq 1 ] && [ "$TMUX_VERSION_MINOR" -ge 7 ] || [ "$TMUX_VERSION_MAJOR" -gt 1 ]' ' \
set -g renumber-windows on'
# Resize the window to the smallest client looking at it, not the smallest client connected to the whole session
setw -g aggressive-resize on
# Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access.
set -s escape-time 50
# pane movement
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
#unbind % # Remove default binding since we’re replacing
#unbind '"' # Remove default binding since we’re replacing
bind | split-window -h
bind - split-window -v
# Make page up scroll up by default
# supported on tmux >= 2 (?)
if-shell '[ "$TMUX_VERSION_MAJOR" -ge 2 ]' ' \
bind-key -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage"'
# option changed in tmux 2.4
if-shell '[ "$TMUX_VERSION_MAJOR" -eq 2 ] && [ "$TMUX_VERSION_MINOR" -ge 4 ] || [ "$TMUX_VERSION_MAJOR" -gt 2 ]' ' \
bind-key -T copy-mode-vi PPage send-keys -X page-up; \
bind-key -T copy-mode-vi NPage send-keys -X page-down; \
' ' \
bind-key -t vi-copy PPage page-up; \
bind-key -t vi-copy NPage page-down; \
'
# Fade inactive panels (disables background transparency in some terminal emulators)
# set-window-option -g window-style 'bg=#181818' # less fade
# set-window-option -g window-style 'bg=#262626' # more fade
# set-window-option -g window-active-style 'bg=black'
# set-window-option -g pane-active-border-style ''
## supported on tmux > 2 (?)
#if-shell '[ "$TMUX_VERSION_MAJOR" -ge 2 ]' ' \
# set-window-option -g window-style "bg=#262626"; \
# set-window-option -g window-active-style "bg=black"; \
# '
# Some terminal emulators require default background color to enable background transparency
if-shell '[ "$TMUX_VERSION_MAJOR" -ge 2 ]' ' \
set-window-option -g window-style "bg=default"; \
set-window-option -g window-active-style "bg=default"; \
'
# Colors
set -g status-bg '#A5A5A5'
set -g status-fg '#424242'
set -g status-left-length 30
set -g status-right-length 23
set -g status-left '#[fg=#404040]#[bg=#8F8F8F] #H #S '
set -g status-right '#[fg=#404040]#[bg=#8F8F8F] %F %H:%M %Z '
#set -g status-left '#[fg=#424242]#[bg=#A5A5A5] #H #S │'
#set -g status-right '#[fg=#424242]#[bg=#A5A5A5]│ %F %H:%M %Z '
# -fg and -bg replaced with -style >=2.9
if-shell '[ "$TMUX_VERSION_MAJOR" -eq 2 ] && [ "$TMUX_VERSION_MINOR" -ge 9 ] || [ "$TMUX_VERSION_MAJOR" -gt 2 ]' ' \
set-window-option -g window-status-current-style "fg=#A5A5A5,bg=#424242"; \
' ' \
set-window-option -g window-status-current-bg "#424242"; \
set-window-option -g window-status-current-fg "#A5A5A5"; \
'
set -g window-status-format ' #I:#W '
set -g window-status-current-format ' #I:#W '
# Use Alt-vim keys without prefix key to switch panes
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 keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Local config
if-shell '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'