Skip to content

Instantly share code, notes, and snippets.

@arooni
Created March 9, 2017 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arooni/57eb7fe10839d933abe180a4538dc24e to your computer and use it in GitHub Desktop.
Save arooni/57eb7fe10839d933abe180a4538dc24e to your computer and use it in GitHub Desktop.
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