2014-03-05 02:55:16 -05:00
|
|
|
let s:save_cpo = &cpo
|
|
|
|
set cpo&vim
|
|
|
|
|
2014-03-05 02:14:53 -05:00
|
|
|
let s:source = {
|
2014-03-06 00:47:55 -05:00
|
|
|
\ 'name' : 'ultisnips',
|
|
|
|
\ 'kind' : 'keyword',
|
|
|
|
\ 'mark' : '[US]',
|
|
|
|
\ 'rank' : 8,
|
|
|
|
\ 'matchers' :
|
|
|
|
\ (g:neocomplete#enable_fuzzy_completion ?
|
|
|
|
\ ['matcher_fuzzy'] : ['matcher_head']),
|
|
|
|
\ }
|
2014-03-05 02:14:53 -05:00
|
|
|
|
2019-05-05 01:05:57 -04:00
|
|
|
function! s:source.gather_candidates(context) abort
|
2014-03-06 00:47:55 -05:00
|
|
|
let suggestions = []
|
|
|
|
let snippets = UltiSnips#SnippetsInCurrentScope()
|
|
|
|
for trigger in keys(snippets)
|
|
|
|
let description = get(snippets, trigger)
|
|
|
|
call add(suggestions, {
|
|
|
|
\ 'word' : trigger,
|
|
|
|
\ 'menu' : self.mark . ' '. description
|
|
|
|
\ })
|
|
|
|
endfor
|
|
|
|
return suggestions
|
2014-03-05 02:14:53 -05:00
|
|
|
endfunction
|
|
|
|
|
2019-05-05 01:05:57 -04:00
|
|
|
function! neocomplete#sources#ultisnips#define() abort
|
2014-03-06 00:47:55 -05:00
|
|
|
return s:source
|
2014-03-05 02:14:53 -05:00
|
|
|
endfunction
|
2014-03-05 02:55:16 -05:00
|
|
|
|
|
|
|
let &cpo = s:save_cpo
|
|
|
|
unlet s:save_cpo
|