Created
June 28, 2014 20:37
-
-
Save yaasita/a82d949e0b0c9f45ed99 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
set completefunc=GoogleComplete | |
function! GoogleComplete(findstart, base) | |
if a:findstart | |
let line = getline('.') | |
let start = col('.') - 1 | |
while start > 0 && line[start - 1] =~ '\S' | |
let start -= 1 | |
endwhile | |
return start | |
else | |
let ret = system('curl -s -G --data-urlencode "q=' | |
\ . a:base . '" "http://suggestqueries.google.com/complete/search?&client=firefox&hl=ja&ie=utf8&oe=utf8"') | |
let res = split(substitute(ret,'\[\|\]\|"',"","g"),",") | |
return res | |
endif | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment