-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
102 lines (82 loc) · 3.14 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
# Originally based on tmux-sensible.
# Source: https://github.com/tmux-plugins/tmux-sensible
###########
# General #
###########
# Set custom prefix.
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
# Enable mouse support.
set -g mouse on
# Enable support for mouse-based highlight/copying on Linux and macOS.
if-shell "command -v xclip >/dev/null 2>&1" \
"bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -selection clipboard -in'"
if-shell "command -v pbcopy >/dev/null 2>&1" \
"bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'pbcopy'"
# Add support for reloading tmux.conf.
bind R source-file "~/.config/tmux/tmux.conf"
# Better color support
set -g default-terminal "screen-256color"
set-option -sa terminal-overrides ",xterm*:Tc"
# Address Vim mode switching delay (http://superuser.com/a/252717/65504)
set -s escape-time 0
# Increase scrollback buffer size to 50,000 lines
set -g history-limit 50000
# Increase tmux messages display duration to 4s
set -g display-time 4000
# Focus events enabled for terminals that support them
set -g focus-events on
# Super useful when using "grouped sessions" and multi-monitor setup
setw -g aggressive-resize on
# Ensure $CWD is used when creating or splitting windows.
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# 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
# Shift-arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
##############
# Status bar #
##############
set -g status-interval 1 # seconds
set -g status-style bg=green,fg=black
set -g status-left " #[fg=black]#{pane_current_path} "
set -g status-right " %Y-%m-%d %H:%M:%S "
###########################
# Vim-style compatability #
###########################
set-window-option -g mode-keys vi
# Vim-style yanking for Linux with xclip
if-shell "command -v xclip >/dev/null 2>&1" \
"bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -selection clipboard -in'"
# Vim-style yanking for macOS with pbcopy
if-shell "command -v pbcopy >/dev/null 2>&1" \
"bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'pbcopy'"
# Support Vim-style visual mode.
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
# Vim-style pane selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Shift-Alt vim keys to switch windows
bind -n M-H previous-window
bind -n M-L next-window
###########
# Plugins #
###########
# Automatically install 'tpm' if it isn't already installed.
if "test ! -d ~/.config/tmux/plugins/tpm" \
'run "git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm && ~/.config/tmux/plugins/tpm/bin/install_plugins"'
set -g @plugin 'tmux-plugins/tpm'
# Ensure plugins are setup
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-yank'
run '~/.config/tmux/plugins/tpm/tpm'