tmux: vi コピーモードでの行単位のテキスト選択

tmux: vi コピーモードでの行単位のテキスト選択

ではtmux、通常、行全体を選択しながらコピーします。

viのコマンドのように、テキストを行単位で選択するにはどうすればよいでしょうかV?

答え1

コピーモードでの解決策は次のとおりです

1. move to the line you want to select
2. pres 0, then the cursor will move to the fist position of this line, 
same as vim
3. enter whitespace (start copy)
4. type $. Then it will highlight the whole line.

答え2

コマンドtmuxは ですselect-line

以下は私が使用しているマッピングの便利なセットです (copy-modeを使用しない場合は を使用しますcopy-mode-vi)。

# Selection / copy / paste
bind-key -T copy-mode-vi v   send -X begin-selection  # default is <space>
bind-key -T copy-mode-vi V   send -X select-line
bind-key -T copy-mode-vi C-v send -X rectangle-toggle  # default is C-v, or R in copy-mode (non-vi)
bind-key -T copy-mode-vi y   send -X copy-pipe-and-cancel 'xclip -selection clipboard -in'
bind p paste-buffer  # default ]

関連情報