-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
67 lines (53 loc) · 2.43 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
set -g default-terminal "screen-256color"
# window title
set-option -g set-titles on
set-option -g set-titles-string '#S:#I.#P #W' # window number,program name,active (or not)
set-window-option -g automatic-rename on # auto name
source-file "${HOME}/.tmux-themepack/powerline/double/cyan.tmuxtheme"
# set-option -g visual-activity off
set-window-option -g monitor-activity on
# Start window numbers from 1
set -g base-index 1
# navigation
bind -n C-right next-window
bind -n C-left previous-window
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# tweaks (see https://mutelight.org/practical-tmux)
set -s escape-time 0
# Enable mouse-scrolling (works as of tmux 1.5)
# set-window-option -g mode-mouse on
# VI mode
set-window-option -g mode-keys vi
# Other bindings
bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."
bind C-l send-keys -R \; clear-history
bind m set-window-option main-pane-width 92\; select-layout main-vertical
# -- Detect TMUX Version --------------------------------------------------------------------
# based on https://stackoverflow.com/a/40902312/1046584
run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6-)"
# UTF8 is autodetected in 2.2 onwards, but errors if explicitly set
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.2" | bc)" = 1 ]' \
"set -g utf8 on; set -g status-utf8 on; set -g mouse-utf8 on"
# New keybindings for vi-mode
# https://github.com/tmux/tmux/issues/754
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.4" | bc)" = 1 ]' \
'bind -T copy-mode-vi v send-keys -X begin-selection ; \
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle ; \
bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel ; \
bind -T copy-mode-vi * send-keys -X copy-pipe-and-cancel "xclip -i" ; \
bind -T copy-mode-vi H send-keys -X start-of-line ; \
bind -T copy-mode-vi L send-keys -X end-of-line ; \
bind -T choice-mode-vi h send-keys -X tree-collapse ; \
bind -T choice-mode-vi l send-keys -X tree-expand ; \
bind -T choice-mode-vi H send-keys -X tree-collapse-all ; \
bind -T choice-mode-vi L send-keys -X tree-expand-all ; \
bind -t vi-copy v begin-selection; \
bind -t vi-copy C-v rectangle-toggle; \
bind -t vi-copy y copy-selection; \
bind -t vi-choice h tree-collapse; \
bind -t vi-choice l tree-expand; \
bind -t vi-choice H tree-collapse-all; \
bind -t vi-choice L tree-expand-all;'