Created
March 9, 2017 02:06
-
-
Save arooni/57eb7fe10839d933abe180a4538dc24e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
if has("unix") | |
let s:uname = system("uname") | |
if s:uname == "Linux\n" | |
" Remote Clipboard | |
function! PropagatePasteBufferToOSX() | |
let @n=getreg('"') | |
call system('pbcopy-remote', @n) | |
echo "done" | |
endfunction | |
function! PopulatePasteBufferFromOSX() | |
let @" = system('pbpaste-remote') | |
echo "done" | |
endfunction | |
nnoremap <leader>3 :call PopulatePasteBufferFromOSX()<cr> | |
nnoremap <leader>2 :call PropagatePasteBufferToOSX()<cr> | |
nnoremap yy yy:call PropagatePasteBufferToOSX()<cr> | |
function! YRRunAfterMaps() | |
nnoremap Y :<C-U>YRYankCount 'y$'<CR> <bar> :call PropagatePasteBufferToOSX()<CR> | |
vnoremap y y:call PropagatePasteBufferToOSX()<CR> | |
endfunction | |
endif | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment