Skip to content

Instantly share code, notes, and snippets.

@eagletmt
Created July 12, 2012 17:39
Show Gist options
  • Save eagletmt/3099559 to your computer and use it in GitHub Desktop.
Save eagletmt/3099559 to your computer and use it in GitHub Desktop.
" let g:android_sdk_path = '/opt/android-sdk'
let s:source = { 'name': 'android-docs' }
function! unite#sources#android_docs#define()
return s:source
endfunction
function! s:source.gather_candidates(args, context)
return map(readfile(g:android_sdk_path . '/docs/sitemap.txt'), 's:create(v:val)')
endfunction
function! s:create(line)
let l:path = substitute(a:line, '^http://[^/]\+', '', '')
let l:fullpath = printf('%s/docs%s', g:android_sdk_path, l:path)
return {
\ 'source': 'android-docs',
\ 'kind': 'uri',
\ 'word': l:fullpath,
\ 'abbr': l:path,
\ 'action__path': l:fullpath,
\ }
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment