I can cat a file, copy and paste text with the middle button or shift-insert.
How can I copy text in vim and paste it from the system clipboard?
clipboardvim
I can cat a file, copy and paste text with the middle button or shift-insert.
How can I copy text in vim and paste it from the system clipboard?
Best Answer
You need to have Vim with the
clipboard
andxtermclipboard
features compiled in. In Ubuntu, these are only available with the vim GUI packages (vim-gnome
,vim-gtk
,vim-athena
, etc.).Once you install one of these, you can copy to (and paste from) the clipboard registers (
*
and+
). From this very informative post on Vi and Vim:To copy to a register, you precede the copy command (
y
) with"
and the name of the register (*
, for example)."*y
, then middle-click to paste, or"+y
and ShiftInsert to paste.