Created
September 15, 2009 12:10
-
-
Save thinca/187243 to your computer and use it in GitHub Desktop.
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
--- 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