-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
88 lines (69 loc) · 2.75 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
# Display mode
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",*256col*:Tc"
# Enable mouse
set -g mouse on
# Remap prefix to ctrl+a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Force a reload of the config file on ctrl+r
unbind r
bind r source-file ~/.tmux.conf \; display-message "Config reloaded"
# Increase message and pane time
set-option -g display-time 2000
set-option -g display-panes-time 2000
# Increase history limit
set-option -g history-limit 30000
# Window and pane index starting with 1
set-option -g base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# Don't ask before closing a pane
unbind-key x
bind-key x kill-pane
bind-key X kill-session
# Intuitive pane split
bind-key v split-window -h -c "#{pane_current_path}"
bind-key h split-window -v -c "#{pane_current_path}"
# Resize better way (2 rows at once)
bind-key -r H resize-pane -L 2
bind-key -r J resize-pane -D 2
bind-key -r K resize-pane -U 2
bind-key -r L resize-pane -R 2
# Pane divider
set-window-option -g pane-border-style fg=colour152,bg=colour234
set-window-option -g pane-active-border-style fg=colour32,bg=colour234
# Dim out any pane that's not active.
set-window-option -g window-style fg=white,bg=colour236
set-window-option -g window-active-style fg=white,bg=colour235
# Status bar colors
set -g status-bg colour25
set -g status-fg colour255
# Command / Message line
set-window-option -g message-style fg=black,bold,bg=colour11
# Visual notification of activity in other windows
set-option -g status-interval 60
setw -g monitor-activity on
set -g visual-activity on
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
# Scroll limit history
set-option -g history-limit 30000
set -g base-index 1