-
Notifications
You must be signed in to change notification settings - Fork 2
/
tmux.conf
94 lines (73 loc) · 2.73 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
# enable proper colours
set -g default-terminal "screen-256color"
# reduce default esc timeout time
set-option -sg escape-time 10
# use reattach-to-user-namespace as the default command
set-option -g default-command "reattach-to-user-namespace -l zsh"
# renumber windows on closing
set -g renumber-windows on
# don't allow zsh to change the names itself
set -g allow-rename off
# fix FocusGained/FocusLost in tmux
set-option -g focus-events on
# start window numbers at 1 to match keyboard order with tmux window order
set -g base-index 1
set-window-option -g pane-base-index 1
# act like vim
setw -g mode-keys vi
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# use meta (alt), shift and arrow keys to adjust panes
bind-key -n M-S-Up resize-pane -U 10
bind-key -n M-S-Down resize-pane -D 10
bind-key -n M-S-Left resize-pane -L 15
bind-key -n M-S-Right resize-pane -R 15
# set the prefix to Ctrl-S
set -g prefix2 C-s
# vim keybindings in copy mode
setw -g mode-keys vi
# 'v' to begin selection as in Vim
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-pipe "reattach-to-user-namespace pbcopy"
# update default binding of `Enter` to also use copy-pipe
unbind-key -T copy-mode-vi Enter
unbind-key -T copy-mode-vi Escape
bind-key -T copy-mode-vi Escape send -X cancel
bind-key -T copy-mode-vi Enter send -X copy-pipe "reattach-to-user-namespace pbcopy"\; send -X cancel
# prefix -> back-one-character
bind-key C-b send-prefix
# prefix-2 -> forward-incremental-history-search
bind-key C-s send-prefix -2
# reload the config file
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# set X to close a window
bind-key X confirm-before kill-window
# don't suspend-client
unbind-key C-z
# configure the status colours
set -g status-left-style fg=#bcbcbc,bg=#005faf
set -g status-style fg=#c9ccd3,bg=#37474f
# configure window colours
set -wg mode-style bg=#005faf
setw -g window-status-format " #I #W#F "
setw -g window-status-current-format " #I #W "
setw -g window-status-current-style fg=#ffffff,bg=#0087ff
setw -g window-status-style bg=#2c393f
setw -g window-status-separator ""
# configure pane colours
set -g pane-border-style fg=#2c393f,bg=#37474f
set -g pane-active-border-style fg=#2c393f,bg=#37474f
# configure message colours
set -g message-style fg=#d5dbe5,bg=#005faf
# show the session name on the left, nothing on the right
set -g status-left " #S "
set -g status-right ""
# increase scrollback lines
set -g history-limit 10000
# split windows with | and -
bind-key | split-window -h -c "#{pane_current_path}"
bind-key - split-window -v -c "#{pane_current_path}"