-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
141 lines (114 loc) · 4.29 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
##### KEY BINDINGS #####
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key a send-prefix
# No delay on Esc key
set -sg escape-time 0
# easy swapping between windows
bind-key C-a last-window
# C-l (clear/redraw screen) and C-k (readline kill-to-end) are overriden below,
# so provide alternatives for those and the rest
bind-key C-h send-keys C-h
bind-key C-j send-keys C-j
bind-key C-k send-keys C-k
bind-key C-l send-keys C-l
# switch panes using Alt-arrow without prefix
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
bind -n C-S-Left resize-pane -L
bind -n C-S-Right resize-pane -R
bind -n C-S-Up resize-pane -U
bind -n C-S-Down resize-pane -D
# move panes between windows
bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
# quickly open an ssh session in a new window
bind-key S command-prompt -p ssh: "new-window -n %1 'ssh %1'"
#########################
##### APPEARANCE #####
# Monitor activity and bells
setw -g monitor-activity on
set -g bell-action any
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
# The modes
setw -g mode-style bold
setw -g mode-fg colour196
setw -g mode-bg colour238
# Clock mode
setw -g clock-mode-colour colour135
setw -g clock-mode-style 24
# Panes
set -g pane-border-bg colour235
set -g pane-border-fg colour238
set -g pane-active-border-bg colour236
set -g pane-active-border-fg colour51
# Status bar
set -g status-keys vi
set -g status-justify centre
set -g status-interval 1
set -g status-position bottom
set -g status-style dim
set -g status-bg colour234
set -g status-fg colour137
set -g status-left " #H #(ip route get 8.8.8.8 2>/dev/null | grep -Po '(?<=src )\\S+') #(ip route get 2001:db8:: 2>/dev/null | grep -Po '(?<=src )\\S+')"
set -g status-left-length 70
set -g status-right '#[fg=colour233,bg=colour241,bold] %a %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S #[fg=colour137,bg=colour234] '
set -g status-right-length 70
# Window status tags
setw -g window-status-style none
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
setw -g window-status-bg colour235
setw -g window-status-fg colour138
setw -g window-status-current-style bold
setw -g window-status-current-bg colour238
setw -g window-status-current-fg colour81
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F '
setw -g window-status-activity-style fg=colour237,bg=red,bright
setw -g window-status-bell-style fg=colour237,bg=blue,bright
#setw -g window-status-bell-bg colour1
#setw -g window-status-bell-fg colour256
# Flash messages
set -g message-style bold
set -g message-fg colour232
set -g message-bg colour166
set -g message-command-fg blue
set -g message-command-bg black
#######################
##### BEHAVIOUR #####
# Window numbering starts from 1
set -g base-index 1
# If two clients connect, resize windows to fit the smaller screen
setw -g aggressive-resize on
# More scrollback than you can shake a stick at
set -g history-limit 20000
# Enable mouse control (clickable windows, panes, resizable panes)
setw -g mouse on
# Don't rename windows automatically
set-option -g allow-rename off
# Terminal string
set -g default-terminal "screen-256color"
# Terminal title setting
set -g set-titles on
set -g set-titles-string "#W | #T"
######################
# 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