Last active
December 5, 2015 18:56
-
-
Save mawaldne/b47337f05446f17a9cbf to your computer and use it in GitHub Desktop.
Vim - Automatically yank to system clipboard from Visual mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Yank normally, but just copy it automatically to your system clipboard as well. | |
Added to my .vimrc. Should work from visual mode when you press y and from ex mode: 1,10YankToSystemRegister | |
" Auto Yank text to the OS X clipboard | |
function! CopyToSystemRegister() | |
let @*=@" | |
endfunction | |
command! -range -bar YankToSystemRegister <line1>,<line2>yank|call CopyToSystemRegister() | |
vnoremap y :YankToSystemRegister<cr> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also started using yankring.vim which is awesome