0

I am trying to easily copy over codes from vim editor to stackedoverflow or other coding webs.

Vim is easy to yank with highlight+y, but those yanked lines do not get pasted to stackOverflow with Ctrl+V outside of the editor. How can I accomplish the mission?

Most of this websites links such as Copying text outside of Vim with set mouse=a enabled have not worked.

I would think this should be a very straight-forward and easy answer but never found one yet.

melpomene
  • 84,125
  • 8
  • 85
  • 148

1 Answers1

1

First of all I recommend using the vim-highlightedyank plugin because it highlights the every time you copy something.

The copy can be achieved by:

"+yip ................ (copy current paragraph to the clipboard)
"+ ................... the clipboard
yip .................. yank inner paragraph

:%y+ ................. copy the whole file to the clipboard

If you have any selection just type:

"+y
SergioAraujo
  • 11,069
  • 3
  • 50
  • 40