Created
July 28, 2014 18:26
-
-
Save avdgaag/db9453f14a26bc4cb19c to your computer and use it in GitHub Desktop.
Revisions
-
avdgaag created this gist
Jul 28, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ function! MyOmniFunc(findstart, base) if a:findstart let existing = matchstr(getline('.')[0:col('.')-1],'#\d*$') return col('.')-1-strlen(existing) endif ruby << EOF require 'open-uri' require 'json' def issues(repo, token) JSON.parse( open( sprintf('https://api.github.com/repos/%s/issues', repo), http_basic_authentication: [token, 'x-oauth-basic'] ).string ).map do |issue| sprintf( %Q|{ "word": "#%s", "menu": "%s" }|, *issue.values_at('number', 'title') ) end end iss = issues('USERNAME/PROJECT', 'TOKEN') VIM.command("return [#{iss.join ','}]") EOF endfunction set omnifunc=MyOmniFunc