-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_tmux.conf
98 lines (80 loc) · 3.48 KB
/
dot_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
# General settings
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
setw -g xterm-keys on
set -s escape-time 10 # faster command sequences
set-option -g set-titles on # to set session title for iterm
set-option -g set-titles-string "#W / #T"
# disallow rename window automatically
set-option -g allow-rename off
# Turn off tmux prefix delay
set-option -g repeat-time 0
set -s focus-events on
# automatically re-index window on window changes
set-option -g renumber-windows on
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with windows
# reload tmux
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'
## COLORSCHEME: minimal
set-option -g status-position bottom
set-option -g status-fg white
set-option -g status-bg default
set-option -g status-style default
set-window-option -g window-status-style fg=colour8
set-window-option -g window-status-current-style fg=colour4
set-option -g message-style fg=white
set-option -g message-style bg=black
set-option -g message-style bright
set -g status-left " "
set -g status-justify centre
set -g status-right " "
setw -g window-status-format " #W "
setw -g window-status-current-format " #W "
## End of theme
# clear both screen and history
bind -n C-l send-keys C-l \; run 'sleep 0.1' \; clear-history
# pane navigation
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
# window navigation
unbind n
unbind p
bind -r C-h previous-window # select previous window
bind -r C-l next-window # select next window
bind Tab last-window # move to last active window
# increase history size
set -g history-limit 5000
# force Vi mode
# really you should export VISUAL or EDITOR environment variable, see manual
set -g status-keys vi
set -g mode-keys vi
# -- 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 H start-of-line 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true'
#-------------------------------------------------------------------------------
# Custom bindings
set -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
# Window management
bind v split-window -v -c "#{pane_current_path}"
bind s split-window -h -c "#{pane_current_path}"
# Synchronize
bind C-x set-window-option synchronize-panes
# MacOS copy
if -b 'command -v pbcopy > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | pbcopy"'
if -b 'command -v reattach-to-user-namespace > /dev/null 2>&1' 'bind y run -b "tmux save-buffer - | reattach-to-user-namespace pbcopy"'