-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
41 lines (34 loc) · 1.02 KB
/
tmux.conf
File metadata and controls
41 lines (34 loc) · 1.02 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
##### Prefix #####
set -g prefix C-a
unbind C-b
bind C-a send-prefix
##### Terminal / Colors #####
set -g default-terminal "tmux-256color"
set -as terminal-overrides ",*:Tc"
##### Mouse #####
set -g mouse on
##### Copy-mode (vi) #####
set -g mode-keys vi
# 让 tmux 尝试走终端剪贴板能力(配合 OSC52)
set -g set-clipboard on
##### Vim-like pane navigation #####
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
##### Resize panes #####
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
##### OSC 52: copy in remote tmux -> local clipboard #####
# 在 copy-mode-vi 里按 y:复制选区,并通过 OSC52 写入「本地终端」剪贴板
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'sh -lc '"'"'
tty=$(tmux display-message -p "#{client_tty}")
python3 - <<PY >"$tty"
import sys, base64
data = sys.stdin.buffer.read()
b64 = base64.b64encode(data).decode("ascii")
sys.stdout.write("\033]52;c;%s\007" % b64)
PY
'"'"''