How to copy a selection to the OS X clipboard

后端 未结 27 2273
野趣味
野趣味 2020-11-29 14:17

I have an area selected in Vim. How can I copy it into the OS X clipboard?

(The OS X clipboard can be written to via a pipe to /usr/bin/pbcopy)

27条回答
  •  Happy的楠姐
    2020-11-29 15:13

    For MacVim and Windows Gvim, simply add the following to your ~/.vimrc:

    set clipboard=unnamed
    

    Now all operations such as yy, D, and P work with the clipboard. No need to prefix them with "* or "+.

提交回复
热议问题