gvim: Easy copying into system clipboard

后端 未结 5 461
庸人自扰
庸人自扰 2021-02-03 23:37

I am using gVim on Ubuntu 10.10. I want to copy (yank) text to the system clipboard, so that the copied text is available in other applications.

This works with \"

5条回答
  •  深忆病人
    2021-02-04 00:00

    I have the very same idea as you, but I did it for years.

    nnoremap yy yy"+yy
    vnoremap y ygv"+y
    

    Note that now yy command does two things: First it yank to register as normal, and then it yank to " register (system clipboard). The y command does the same thing. This is because I want to keep the multiple clipboard functionality of Vim.

    For pasting from system clipboard, I used to have noremap gp "+p (global pasting), but now I use the excellent plugin Yankring.

提交回复
热议问题