-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.tmux.conf
100 lines (78 loc) · 4.13 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
# Set tmux version information as environment variables
run-shell "tmux set-environment -g TMUX_VERSION_MAJOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f1 | sed 's/[^0-9]*//g')"
run-shell "tmux set-environment -g TMUX_VERSION_MINOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f2 | sed 's/[^0-9]*//g')"
# set the tmux window option xterm-keys so that tmux will pass these keys through to its terminals
setw -g xterm-keys on
# set the default TERM
set -g default-terminal screen
# update the TERM variable of terminal emulator when creating a new session or attaching a existing session
set -g update-environment 'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM'
# determine if we should enable 256-colour support
if "[[ ${TERM} =~ 256color || ${TERM} == fbterm ]]" 'set -g default-terminal screen-256color'
# C-b is not acceptable -- uncomfortable to reach
set-option -g prefix C-a
bind-key C-a last-window
# Start numbering at 1
set -g base-index 1
set-window-option -g pane-base-index 1
# utf8 is on
if-shell 'test $TMUX_VERSION_MAJOR -eq 2 -a $TMUX_VERSION_MINOR -lt 3' 'set -g utf8 on'
if-shell 'test $TMUX_VERSION_MAJOR -eq 2 -a $TMUX_VERSION_MINOR -lt 3' 'set -g status-utf8 on'
# address vim mode switching delay (http://superuser.com/a/252717/65504)
set -s escape-time 0
# increase scrollback buffer size
set -g history-limit 50000
# tmux messages are displayed for 4 seconds
set -g display-time 4000
# refresh 'status-left' and 'status-right' more often
set -g status-interval 5
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# Allows us to use C-a a <command> to send commands to a TMUX session inside
# another TMUX session
bind-key a send-prefix
# Activity monitoring
setw -g monitor-activity off
set -g visual-activity off
# Vi copypaste mode
bind C-a copy-mode
set-window-option -g mode-keys vi
if-shell 'test $TMUX_VERSION_MAJOR -eq 2 -a $TMUX_VERSION_MINOR -le 3' 'bind-key -t vi-copy v begin-selection'
if-shell 'test $TMUX_VERSION_MAJOR -eq 2 -a $TMUX_VERSION_MINOR -le 3' 'bind-key -t vi-copy y copy-selection'
if-shell 'test $TMUX_VERSION_MAJOR -eq 2 -a $TMUX_VERSION_MINOR -ge 4' 'bind -T copy-mode-vi v send -X begin-selection'
if-shell 'test $TMUX_VERSION_MAJOR -eq 2 -a $TMUX_VERSION_MINOR -ge 4' 'bind -T copy-mode-vi y send -X copy-selection-and-cancel'
if-shell 'test $TMUX_VERSION_MAJOR -eq 3' 'bind -T copy-mode-vi v send -X begin-selection'
if-shell 'test $TMUX_VERSION_MAJOR -eq 3' 'bind -T copy-mode-vi y send -X copy-selection-and-cancel'
bind C-p paste-buffer
bind-key \; command-prompt 'rename-session %%'
# auto window rename
set-window-option -g automatic-rename
set-option -g allow-rename off
# Enable mouse, distinct between tmux <= 2.0 and == 2.1
if-shell 'test $TMUX_VERSION_MAJOR -eq 1 -o $TMUX_VERSION_MAJOR -eq 2 -a $TMUX_VERSION_MINOR -lt 1' 'set -g mode-mouse on'
if-shell 'test $TMUX_VERSION_MAJOR -ge 2 -a $TMUX_VERSION_MINOR -eq 1' 'set -g mouse on'
if-shell 'test $TMUX_VERSION_MAJOR -ge 2 -a $TMUX_VERSION_MINOR -eq 1' 'set -g mouse-utf8 on'
# tmux confirm-before -p "Proceed to kill server (y/N)?" kill-server
bind-key Q confirm-before kill-server
# force a reload of the config file
bind r source-file ~/.tmux.conf\; display-message "Config reloaded..."
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on'
set -g @continuum-kill-default 'on'
set -g @continuum-save-interval '15' # Unit: minutes
#set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @shell_mode 'vi'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'Morantron/tmux-fingers'
set -g @fingers-hint-format "#[fg=red, bold][%s]"
# Apply tmux style based on vim airline
source-file ~/.tmuxline
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'