-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
67 lines (52 loc) · 2.3 KB
/
Copy pathtmux.conf
File metadata and controls
67 lines (52 loc) · 2.3 KB
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
# Increase scrollback buffer size from 2000 to 50000 lines
set -g history-limit 50000
# Enable mouse scrolling
set -g mouse on
# Enable focus events
set -g focus-events on
# Enable true color support
set -g default-terminal "tmux-256color"
set -sa terminal-overrides ",*:RGB"
# Clipboard via OSC 52, so copies reach the local machine over SSH
set -s set-clipboard on
# copy mode vim motions
set-window-option -g mode-keys vi
# Inactive pane background/foreground
set -g window-style 'fg=terminal,bg=brightblack'
# Active pane background/foreground
set -g window-active-style 'fg=terminal,bg=terminal'
# moving between panes with vim movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize the pane
bind-key -r J resize-pane -D 3
bind-key -r K resize-pane -U 3
bind-key -r H resize-pane -L 3
bind-key -r L resize-pane -R 3
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
# No pipe target: the selection goes to a tmux buffer and, because set-clipboard
# is on, out to the terminal via OSC 52. tmux never shells out to a clipboard
# tool, so on a terminal that drops OSC 52 only the tmux buffer gets set.
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel
# Re-bind through a local clipboard tool when the host has one. A pipe target
# does not suppress OSC 52, so this is purely additive: it rescues terminals
# that discard OSC 52 (Terminal.app, older VTE) while leaving SSH unaffected.
# First match wins, so list most-specific first.
run-shell 'for c in pbcopy clip.exe wl-copy "xsel -ib" "xclip -selection clipboard"; do \
command -v "${c%% *}" >/dev/null 2>&1 || continue; \
tmux bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "$c"; \
tmux bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "$c"; \
break; \
done'
# Split panes and windows in the same directory
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# Plugins (TPM)
set -g @plugin 'tmux-plugins/tpm'
# Initialize TPM - keep this line at the very bottom
run '~/.tmux/plugins/tpm/tpm'