-
Notifications
You must be signed in to change notification settings - Fork 3
/
.tmux.conf
147 lines (112 loc) · 4.52 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
142
143
144
145
146
147
# Remap prefix
set -g prefix C-a # instead of C-a
bind C-a send-prefix
unbind C-b
# Load the correct term colors
set -g default-terminal "xterm-256color"
# Reload tmux config
bind r source-file ~/.tmux.conf
# use Alt+s for horizontal split
bind -n C-w split-window -v
# use Alt+s v for vertical split
bind -n C-s split-window -h
# Attach session to current pane working directory
bind -n C-q attach-session -c "#{pane_current_path}"
# vim like window navigation
bind -n C-h select-pane -L
bind -n C-j select-pane -D
bind -n C-k select-pane -U
bind -n C-l select-pane -R
# Zoom current pane
#bind -n C-q resize-pane -Z
set -g history-limit 50000
set -g allow-rename off
set -g base-index 1 # start windows numbering at 1
# pane resizing
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2 bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
# kill pane
bind q killp
# create window
bind C-c new-window
# maximize current pane
bind + run 'cut -c3- ~/.tmux.conf | sh -s _maximize_pane "#{session_name}" #D'
# Window Navigation
bind-key -n C-0 select-window -t :0
bind-key -n C-1 select-window -t :1
bind-key -n C-2 select-window -t :2
bind-key -n C-3 select-window -t :3
bind-key -n C-4 select-window -t :4
bind-key -n C-5 select-window -t :5
bind-key -n C-6 select-window -t :6
bind-key -n C-7 select-window -t :7
bind-key -n C-8 select-window -t :8
bind-key -n C-9 select-window -t :9
# Switch to last window
bind-key -n C-] next-window
bind-key -n C-[ previous-window
# -- edit mode (tmux < 2.4) ----------------------------------------------------
# vi-edit is gone in tmux >= 2.4
run -b 'tmux bind -ct vi-edit H start-of-line 2> /dev/null || true'
run -b 'tmux bind -ct vi-edit L end-of-line 2> /dev/null || true'
run -b 'tmux bind -ct vi-edit q cancel 2> /dev/null || true'
run -b 'tmux bind -ct vi-edit Escape cancel 2> /dev/null || true'
# setw -g mouse on
# -- copy mode -----------------------------------------------------------------
bind Enter copy-mode # enter copy mode
run -b 'tmux bind -t vi-copy v begin-selection 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi v send -X begin-selection 2> /dev/null || true'
run -b 'tmux bind -t vi-copy C-v rectangle-toggle 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi C-v send -X rectangle-toggle 2> /dev/null || true'
run -b 'tmux bind -t vi-copy y copy-selection 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true'
run -b 'tmux bind -t vi-copy Escape cancel 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi Escape send -X cancel 2> /dev/null || true'
run -b 'tmux bind -t vi-copy 0 start-of-line 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi H send -X start-of-line 2> /dev/null || true'
run -b 'tmux bind -t vi-copy L end-of-line 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true'
# copy to X11 clipboard
if -b 'command -v xsel > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xsel -i -b"'
if -b '! command -v xsel > /dev/null 2>&1 && command -v xclip > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | xclip -i -selection clipboard >/dev/null 2>&1"'
# -- buffers -------------------------------------------------------------------
bind b list-buffers # list paste buffers
bind p paste-buffer # paste from the top paste buffer
bind v choose-buffer # choose which buffer to paste from
# Join windows
set-window-option -g mode-keys vi
# run-shell /opt/tmux-logging/logging.tmux
set -ga terminal-overrides ",*256col*:Tc"
set-option -g allow-rename off
# Use ALT+TAB to switch between windows
#Plugins
#set -g @plugin 'tmux-plugins/tmux-logging'
# <prefix>+P
######################
### DESIGN CHANGES ###
######################
# loud or quiet?
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none
# modes
setw -g clock-mode-colour colour5
setw -g mode-style 'fg=colour008 bg=colour111 bold'
# panes
set -g pane-border-style 'fg=colour245 bg=default'
set -g pane-active-border-style 'bg=default fg=colour208'
# statusbar
set -g status-position top
set -g status-justify centre
#set -g status-style 'bg=colour222 fg=colour235' # light theme
#set -g window-status-current-style fg=default,bg=colour221
set -g status-style 'bg=colour234 fg=colour7' # full black
set -g window-status-current-style fg=colour221,bg=default
set -g status-left-length 85
set -g status-left ' #{pane_current_path}'
set -g status-right '%A %d/%m %H:%M '
set-option -g status-interval 1
#set -g pane-border-lines heavy