Copy between tmux sessions without including line numbers

clipboardtmuxvim

When I try to copy and paste between tmux sessions or windows, one problem is that I usually have line numbers displayed when using Vim and tmux copies the line numbers:enter image description here

Is there any way to avoid this?

Best Answer

tmux has the rectangle-toggle command for this. It's not fully explained in the man page; it only appears in the list of commands available during copy mode:

Command             vi      emacs
               [...]
rectangle-toggle    v       R

It switches between the line-based selection you demonstrate, and rectangular selection (similar to Vim's blockwise visual mode). In the latter mode, you can start your selection at static and extend down+right without taking in anything to the left (the line numbers).

Related Question