Setup VIM Copy Mode in Tmux
更新時間:2022 年 2 月 10 日 @Mane
吐槽:tmux 自帶的複製粘貼模式真的好難用,按錯了好多次,有時候習慣了 vim 大法換到 tmux 卻不知道按什麽,在網上搜索了一段時間找到了這篇文章,還好 tmux 内置的複製器支持 vim 的按鍵。
Edit ~/.tmux.conf
this file.
apt -y install xclip
配置文件如下:GLIST
setw -g mode-keys vi
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
bind P paste-buffer
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
set -g mouse on
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
以前是:
Enter ‘copy mode’ by pressing CTRL+b, [.
Use the arrow keys to go to the position from where you want to start copying. Press CTRL+SPACE to start copying.
Use arrow keys to go to the end of text you want to copy. Press ALT+w or CTRL+w to copy into Tmux buffer.
Press CTRL+b, ] to paste in a possibly different Tmux pane/window.
現在是:
-
Enter ‘copy mode’ by pressing
CTRL+b
,[
. -
Yeah, you enter the vim Copy mode just use the key like in vim.
-
Press
CTRL+b
,]
to paste in a possibly different Tmux pane/window.
Comments
Post a Comment