-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtmux.conf
More file actions
72 lines (55 loc) · 2.21 KB
/
tmux.conf
File metadata and controls
72 lines (55 loc) · 2.21 KB
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
# Use screen's prefix
set-option -g prefix C-a
# Index of the first window in session
set -g base-index 1
# Stops tmux from auto-renaming windows
set-option -g allow-rename off
# Proper colors for vi with termguicolors
set -g default-terminal "tmux"
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Remove ESC delay in vim
set -g escape-time 10
set -g mouse on
# Window list position
set -g status-justify left
# Enable activity alerts
setw -g monitor-activity on
set -g visual-activity on
# Status bar colors
set -g status-fg white
set -g status-bg default
setw -g window-status-current-style fg=black,bg=white
set-window-option -ga window-status-activity-style fg=blue
# Reload config file
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# Vi-style copypaste
# Use system clipboard with xsel
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
# C-a a to send C-a into terminal
bind-key a send-prefix
# Switch to last window with C-a C-a
bind-key C-a last-window
# 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"
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
# Intuitive split bindings
bind-key - split-window -v -c "#{pane_current_path}"
bind-key | split-window -h -c "#{pane_current_path}"
# Move window to the left or right
bind-key < swap-window -t -1
bind-key > swap-window -t +1
# Local configuration
if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'