文章参考:http://vim.wikia.com/wiki/In_line_copy_and_paste_to_system_clipboard。
将以下内容添加到~/下的.vimrc
" On OSX vmap <C-c> y:call system("pbcopy", getreg("\""))<CR> nmap <C-v> :call setreg("\"",system("pbpaste"))<CR>p
" On ubuntu (running Vim in gnome-terminal) " The reason for the double-command on <C-c> is due to some weirdness with the X clipboard system. vmap <C-c> y:call system("xclip -i -selection clipboard", getreg("\""))<CR>:call system("xclip -i", getreg("\""))<CR> nmap <C-v> :call setreg("\"",system("xclip -o -selection clipboard"))<CR>p
原文地址:http://blog.csdn.net/fnzsjt/article/details/46368733