-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
128 lines (98 loc) · 4.22 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
# Prefix CTRL+A
set -g prefix C-space
unbind-key C-b
bind-key C-space send-prefix
# Auto window titles
setw -g automatic-rename on
set -g set-titles on
# 24h clock
setw -g clock-mode-style 24
# Stop Esc key triggering an Alt keypress
set -s escape-time 0
# OR stop windows terminal ssh from putting escape sequences in the terminal...
#set -s escape-time 100
# Stop that stupid bell
set -g bell-action none
# Refresh agent forwarding on reconnect
set-option -g update-environment "SSH_AUTH_SOCK"
set -g mode-keys vi
# Start my custom terminal
set -g default-command bash
set -g default-terminal "screen-256color"
# Mouse off
set -g mouse off
# Increase time for bind -r
set -g repeat-time 900
# Split panes with Ctrl+hv
bind-key -n M-h split-window -h
bind-key -n M-v split-window -v
bind-key r source-file ~/.tmux.conf
# Switch panes with Alt+hjkl
bind-key -n M-j select-pane -L
bind-key -n M-k select-pane -D
bind-key -n M-i select-pane -U
bind-key -n M-l select-pane -R
bind-key -r j resize-pane -L 5
bind-key -r k resize-pane -D 5
bind-key -r i resize-pane -U 5
bind-key -r l resize-pane -R 5
# Kill pane with q
bind-key q kill-pane
# Start tabs with index 1
set -g base-index 1
setw -g pane-base-index 1
# Switch windows alt+number
bind-key -n M-1 if-shell 'tmux select-window -t 1' '' 'new-window -t 1'
bind-key -n M-2 if-shell 'tmux select-window -t 2' '' 'new-window -t 2'
bind-key -n M-3 if-shell 'tmux select-window -t 3' '' 'new-window -t 3'
bind-key -n M-4 if-shell 'tmux select-window -t 4' '' 'new-window -t 4'
bind-key -n M-5 if-shell 'tmux select-window -t 5' '' 'new-window -t 5'
bind-key -n M-6 if-shell 'tmux select-window -t 6' '' 'new-window -t 6'
bind-key -n M-7 if-shell 'tmux select-window -t 7' '' 'new-window -t 7'
bind-key -n M-8 if-shell 'tmux select-window -t 8' '' 'new-window -t 8'
bind-key -n M-9 if-shell 'tmux select-window -t 9' '' 'new-window -t 9'
bind-key -n M-0 if-shell 'tmux select-window -t 10' '' 'new-window -t 10'
# Change current pane to next window
bind-key 1 if-shell 'tmux join-pane -t :1' '' 'new-window -d -t 1; join-pane -t :1 ; kill-pane -a'
bind-key 2 if-shell 'tmux join-pane -t :2' '' 'new-window -d -t 2; join-pane -t :2 ; kill-pane -a'
bind-key 3 if-shell 'tmux join-pane -t :3' '' 'new-window -d -t 3; join-pane -t :3 ; kill-pane -a'
bind-key 4 if-shell 'tmux join-pane -t :4' '' 'new-window -d -t 4; join-pane -t :4 ; kill-pane -a'
bind-key 5 if-shell 'tmux join-pane -t :5' '' 'new-window -d -t 5; join-pane -t :5 ; kill-pane -a'
bind-key 6 if-shell 'tmux join-pane -t :6' '' 'new-window -d -t 6; join-pane -t :6 ; kill-pane -a'
bind-key 7 if-shell 'tmux join-pane -t :7' '' 'new-window -d -t 7; join-pane -t :7 ; kill-pane -a'
bind-key 8 if-shell 'tmux join-pane -t :8' '' 'new-window -d -t 8; join-pane -t :8 ; kill-pane -a'
bind-key 9 if-shell 'tmux join-pane -t :9' '' 'new-window -d -t 9; join-pane -t :9 ; kill-pane -a'
bind-key 0 if-shell 'tmux join-pane -t :10' '' 'new-window -d -t 10; join-pane -t :10 ; kill-pane -a'
# https://github.com/samoshkin/tmux-config/blob/master/tmux/tmux.conf#L365
bind -T root F12 \
set prefix None \;\
set key-table off \;\
if -F '#{pane_in_mode}' 'send-keys -X cancel' \;\
refresh-client -S \;\
bind -T off F12 \
set -u prefix \;\
set -u key-table \;\
refresh-client -S
keymap_disabled="#([ $(tmux show-option -qv key-table) = 'off' ] && echo ' OFF ')"
# DESIGN
# modes
setw -g clock-mode-colour colour0
setw -g mode-style fg=colour0,bg=colour45,bold
# panes
set -g pane-border-style fg=colour45,bg=colour0
set -g pane-active-border-style fg=colour9,bg=colour0
# statusbar
set -g status-position bottom
set -g status-justify left
set -g status-style fg=colour231,bg=colour45,dim
set -g status-left ' '
set -g status-right "#[fg=colour196,bg=colour232]$keymap_disabled#[default] #[bg=colour232] %Y-%m-%d %H:%M #[default] "
set -g status-right-length 50
set -g status-left-length 20
setw -g window-status-current-style fg=colour45,bg=colour234
setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W '
setw -g window-status-style fg=colour45,bg=colour232
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W '
setw -g window-status-bell-style fg=colour255,bg=colour1,bold
# messages
set -g message-style fg=colour0,bg=colour12