vmap <C-c> y:call system("pbcopy", getreg("\""))<CR>
nmap <C-v> :call setreg("\"",system("pbpaste"))<CR>p
This basically sets it up so that when you select any shape in visual mode (visual-blocks too), pressing Ctrl-C (not Cmd), will send that chunk of text the system clipboard.
There is also a mechanic for making it work with Linux as well. I've toyed with the idea of making it copy on every y/d/c/s as well, but I do that enough that it would destroy the system clipboard every time I used vim :P. Oh well.

No comments:
Post a Comment