Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sgur
Created May 13, 2013 16:20
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 sgur/5569560 to your computer and use it in GitHub Desktop.
Save sgur/5569560 to your computer and use it in GitHub Desktop.
googlesuggest-complete-vim (https://github.com/mattn/googlesuggest-complete-vim) を &filetype で絞り込む変更
diff --git a/autoload/googlesuggest.vim b/autoload/googlesuggest.vim
index eb3ae37..3f652ab 100644
--- a/autoload/googlesuggest.vim
+++ b/autoload/googlesuggest.vim
@@ -68,12 +68,11 @@ function! googlesuggest#Complete(findstart, base)
else
" find months matching with "a:base"
let ret = []
- let res = webapi#http#get('http://suggestqueries.google.com/complete/search', {"client" : "youtube", "q" : a:base, "hjson" : "t", "hl" : g:googlesuggest_language, "ie" : "UTF8", "oe" : "UTF8" })
+ let res = webapi#http#get('http://suggestqueries.google.com/complete/search', {"client" : "youtube", "q" : &filetype . ' ' . a:base, "hjson" : "t", "hl" : g:googlesuggest_language, "ie" : "UTF8", "oe" : "UTF8" })
let arr = webapi#json#decode(res.content)
for m in arr[1]
- call add(ret, m[0])
+ call add(ret, substitute(m[0], '^' . &filetype . '\s', '', 'g'))
endfor
return ret
endif
endfunction
-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment