2020年5月27日 星期三

tmux pane 間 copy/paste 的設定

tmux pane 之間的複製貼上因 copy mode 開始複製的 hotkey 跟輸入法切換器的 hotkey 衝突,
故改為 v 開始選擇,y 複製到 buffer。


以下貼到 ~/.tmux.conf
# Use v to trigger selection 
bind-key -T copy-mode v send-keys -X begin-selection

# Use y to yank current selection
bind-key -T copy-mode y send-keys -X copy-selection-and-cancel


------------------------------------
  1. <PREFIX> + [ 進入 copy mode。
  2. v 開始選擇。以方向鍵移動,會反白。
  3. y 複製到 buffer。
  4. <PREFIX> + ] 貼上 buffer 內的內容。


ps. <PREFIX> default 為 Ctrl-b
pps. $ tmux list-keys 可以列出 bind 的 keys


沒有留言: