Is it possible to copy to clipboard directly from Vim? yy only copies stuff to Vim’s internal buffer. I want to copy to the OS’s clipboard. Is there any such command in Vim or you can only yank stuff within Vim?
Is it possible to copy to clipboard directly from Vim? yy only copies stuff
Share
The
*register will do this. In Windows,+and*are equivalent. In unix there is a subtle difference between+and*:*is probably what you want most of the time, so I use*because it functions as I expect it to in both environments.In Linux distros you have to install
vim-gtk(akagvim) first to gain clipboard functionality. This is because non-gtk vim is typically compiled without X11 support. This is to allow it to run on console only machines (often servers).And for those confused about how to use registers when yanking or putting, you merely write
"then the name of the register. So for copying something to the clipboard register you type"*yand then to put you type"*p(credit: Kyle Mathews)