Copy from vim to python console in tmux

first your vim should be compiled with +clipboard see vim --version | grep 'clipboard'

To copy ( or delete ) in any vim register you can use the following syntex

  • "<register name><oprator><motion> (see :h registers )e.g.
    1. "ayy(copy current line in register a) or
    2. "bdd(delete current line in register b) or
    3. "*ce(delete to the end of the current work and place content in register * using c will also put you in insert mode
  • to copy whole line you can use yy
  • and system clipboard is mapped to either + or * ( depending on the os )

so to copy the whole line into system clipboard you can use

  • "*yy or "+yy (depending on the os)

or to copy 2 lines

  • "*2yy or "+2yy ( to copy current and the line after current line )

once the content is copied in the system clipboard you can paste in tmux using ( command + v or ctrl + shift + v )

or to map system clipboard with tmux paste buffer see https://unix.stackexchange.com/questions/67673/copy-paste-text-selections-between-tmux-and-the-clipboard#72340