If you're doing this in X such as KDE or Gnome, then once you select the text it will be in your X server's "
primary selection keyboard". You don't explicitly copy the text, only select. Then, make sure
vi is in insert mode, place your cursor in the
vi window, and click the middle mouse button.
- Select text in any window (which copies into the X "
primary selection clipboard").
insert mode (for example, press the "i" key on your keyboard).
- Click the middle mouse button anywhere in the
vi window to paste the contents of your "
primary selection clipboard" at your
vi insertion point.
You might need to adjust some features in
vi, such as
:set noautoindent, because if there are any spaces at the beginning of lines,
autoindent will cause your pasted text to cascade to the right of the screen. There may be other settings affecting how the text is entered into the