This problem has been frequently encountered recently, recorded here.
My environment
- System
Archlinux
- Vim
NVIM v0.2.2 / vim 8.0.1297
Premise
Requires VIM support+clipboard
- Check method
vim --version | grep clipboard
- If you are using unsupported
vim-minimal
, installation gvim
can be solved, the command line version will also support after installation
- As for Nvim, I'm not quite sure, as if VIM supports it???
Begin
No longer details of Vim's copy-and-paste cache system, only introduction to the method, in particular, can refer to a variety of detailed information on the blog
Copy from Vim to system pasteboard
- Similar to using normal
y
commands, you "+y
can copy content to the system pasteboard only
Copy from System Pasteboard to Vim
- Method 1:
p
Similar to the command, you only need to replace the "+p
- Method 2: First vim input command
:set paste
(so that the paste effect is good, no strange indentation), insert mode using the terminal paste function
Replication between multiple Vim
- If it is the same vim process with different buffer, can be directly
p / y
without problems
- If it is a different process, it can be done as mentioned above, that is
+寄存器
, the previous"+y / "+p
Finally, say something.
In simple terms, you can follow: < double quotes >< register name >< command > To use different vim registers, and the command to view registers is:reg
I'm just going to take a note of the simple procedure, the principle of vim register is interested in reading the vim of the document and a variety of blog bar ~
A brief introduction to the interoperability of vim and system pasteboard