kidd
Packager
Vectorian
   
Posts: 682
|
 |
« Reply #1 on: December 25, 2007, 11:19:44 am » |
|
Vim's clipboard system behaves in a weird way if you don't fully understand it.
I'll try to write a small introduction to it:
1.) Clipboards in X windows:
X running in linux environments has 2 registers where you can copy/paste text. - ctrl-c/ctrl-v - Mouse selection / middle-click (or shift-insert)
2) Vim and registers: You can refer to a given register prepending a double quote (") and the register ID to the yank command Vim has lots of registers where you can leave and retrieve text. Most common ones are the numbered registers, ", +, * and '/'. When you copy anything with 'y', this text gets pushed into '"' register, and the "0. "0 goes to "1, "1 goes to "2..... If you specify a register, the text will be placed in the specifyed reg, and the "0 reg. "0 goes to "1, "1 goes to "2..... "+ refers to the ctr-c/ctrl-v clipboard, and "* refers to the mouse selection/shift-ins one.
copying a line to the "+ register is done with "+yy pasting a the "+ register is done with "+p
If you don't wanna mess with all that (It's powerful, but a bit complicated), you can set an option to your ~/.vimrc
:set clipboard=unnamed
This way, "* register will be used when you don't specify any register. This way, vim shares the clipboard with other applications and other vim instances (without special tricks).
aditional help in :h clipboard, and :h 'clipboard' inside vim.
HTH
|