-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
95 lines (70 loc) · 2.67 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
# remap prefix to CTRL+a
set -g prefix C-a
bind C-a send-prefix
unbind C-b
unbind p
# set mouse control
set -g mouse on
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set -g history-limit 50000
# set terminal 256color
set-option -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
set-option -g set-titles on
set-option -g set-titles-string '#{pane_title}'
# make delay minimal
set -sg escape-time 0
# split pane with | and -
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind p previous-window
bind N command-prompt 'new-session -c "#{pane_current_path}" -s %%'
bind c new-window -c "#{pane_current_path}"
bind r source-file ~/.tmux.conf
# default statusbar colors
set-option -g status-style bg=colour235,fg=colour136,default
# default window title colors
set-window-option -g window-status-style fg=colour244,bg=default
# active window title colors
set-window-option -g window-status-current-style fg=colour166,bg=default
set-option -g status-interval 5
set-option -g automatic-rename on
set-option -g automatic-rename-format '#{pane_current_command}:#{b:pane_current_path}'
# pane border color
set-option -g pane-border-style fg=colour236
set-option -g pane-active-border-style fg=colour244
# message text
set-option -g message-style bg=colour235,fg=colour166
# pane number display
set-option -g display-panes-active-colour colour33
set-option -g display-panes-colour colour166
set -g status-justify left
setw -g monitor-activity off
set -g visual-activity off
# custom status line
set -g status-left ""
set -g status-right "#(whoami)@#H#[default] "
# Smart pane switching with awareness of vim splits
is_vim='tmux show-env tmux_navigator_bypass_#{pane_id} >/dev/null 2>&1 \
|| echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# renumber windows automatically when one gets deleted
set-option -g renumber-windows on
# copy and paste
bind Escape copy-mode
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
unbind Enter
bind-key Enter resize-pane -Z
# move current window
bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1
bind-key -nr C-Up resize-pane -U
bind-key -nr C-Down resize-pane -D
bind-key -nr C-Left resize-pane -L
bind-key -nr C-Right resize-pane -R