Skip to content

Instantly share code, notes, and snippets.

@thinca thinca/fakeclip.diff
Created Sep 15, 2009

Embed
What would you like to do?
--- 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
You can’t perform that action at this time.