tmux 複製粘貼

tmux版本(tmux 2.3):linux

 $tmux -V

 

要想讓tmux和系統剪貼板之間互相複製粘貼,在linux中須要先安裝 xclip:緩存

sudo apt-get install xclip

 而後在 .tmux.conf 文件中:bash

# 把當前緩存區的內容複製到系統剪貼板
bind -t vi-copy y copy-pipe "xclip -sel clip -i" 

# 把系統剪貼板內容複製到tmux
bind P run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"