-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
74 lines (59 loc) · 2.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
setw -g xterm-keys on
# Start window numbering at 1
set-option -g base-index 1
set-window-option -g pane-base-index 1
# Reload config with a key
bind-key r source-file ~/.tmux.conf \; display "Config reloaded!"
# Enable mouse
set -g mouse on
# Scrolling works as expected
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Set tmux to use 256 color (needed for truecolor)
set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Use the system clipboard (requried for MacOS)
set-option -g default-command "reattach-to-user-namespace -l $SHELL"
# split panes using v and s
bind v split-window -h
bind s split-window -v
unbind '"'
unbind %
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L; refresh-client -S
bind -n M-Right select-pane -R; refresh-client -S
bind -n M-Up select-pane -U; refresh-client -S
bind -n M-Down select-pane -D; refresh-client -S
# Use vim keybindings in copy mode
set-window-option -g mode-keys vi
# Bind escape to copy mode
bind Escape copy-mode
# Low escape time
set -sg escape-time 0
# Vim-like v / y / p for select / copy / paste
# Update default binding of `Enter` to also use copy-pipe
run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6-)"
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.4" | bc)" = 1 ]' \
"\
bind-key -t vi-copy Escape cancel; \
bind-key -t vi-copy v begin-selection; \
bind-key -t vi-copy V select-line; \
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"; \
unbind p; bind p paste-buffer"
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.4" | bc)" = 1 ]' \
"\
bind-key -T copy-mode-vi 'v' send -X begin-selection; \
bind-key -T copy-mode-vi 'V' send -X select-line; \
bind-key -T copy-mode-vi 'y' send -X copy-pipe "reattach-to-user-namespace pbcopy""
unbind p
bind p paste-buffer
# Theme
source ~/.tmux.theme
#### PLUGINS
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'kristijanhusak/tmux-simple-git-status'
#### PLUGINS
run '~/.tmux/plugins/tpm/tpm'