Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to copy and paste using clipboard in Vim

📅 2014-May-20 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

Vim can copy or paste to the X clipboard or the desktop clipboard. This is useful to copy text from Vim to an external application or vice versa. This is also useful to copy and paste between multiple instances of Vim running in different terminals.

This capability is available in Vim only if it has been compiled with the +clipboard feature. With this feature, the doublequote-plus register "+ of Vim is connected to the desktop clipboard. Anything you cut, copy or yank to this register appears in the system clipboard. If you paste from this register in Vim, then the text in the clipboard appears at the paste location.

Tried with: Vim 7.4 and Ubuntu 16.04