Skip to content

Instantly share code, notes, and snippets.

@thinca
Created September 15, 2009 12:10
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 thinca/187243 to your computer and use it in GitHub Desktop.
Save thinca/187243 to your computer and use it in GitHub Desktop.
--- autoload/fakeclip.vim.orig 2009-09-15 21:09:21.000000000 +0900
+++ autoload/fakeclip.vim 2009-09-15 20:45:03.000000000 +0900
@@ -27,6 +27,8 @@
let s:PLATFORM = 'mac'
elseif has('win32unix')
let s:PLATFORM = 'cygwin'
+elseif $DISPLAY != '' && executable('xclip')
+ let s:PLATFORM = 'xclip'
else
let s:PLATFORM = 'unknown'
endif
@@ -131,6 +133,11 @@
endfunction
+function! s:read_clipboard_xclip()
+ return system('xclip -o')
+endfunction
+
+
function! s:read_clipboard_unknown()
echoerr 'Getting the clipboard content is not supported on this platform:'
\ s:PLATFORM
@@ -174,6 +181,12 @@
endfunction
+function! s:write_clipboard_xclip(text)
+ call system('xclip', a:text)
+ return
+endfunction
+
+
function! s:write_clipboard_unknown(text)
echoerr 'Yanking into the clipboard is not supported on this platform:'
\ s:PLATFORM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment