Skip to content

Instantly share code, notes, and snippets.

@kates
Created September 6, 2013 09:38
Show Gist options
  • Save kates/6461653 to your computer and use it in GitHub Desktop.
Save kates/6461653 to your computer and use it in GitHub Desktop.
vim copy/paste to system clipboard
let os = substitute(system('uname'), "\n", "", "")
if os == "Darwin"
vmap <C-c> y:call system("pbcopy", getreg("\""))<CR>:echo "copied to system clipboard"<CR>
nmap <C-v> :call setreg("\"", system("pbpaste"))<CR>p:echo ""<CR>
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment