diff --git a/autoload/neocomplete/sources/ultisnips.vim b/autoload/neocomplete/sources/ultisnips.vim index 2b52d57..385a779 100644 --- a/autoload/neocomplete/sources/ultisnips.vim +++ b/autoload/neocomplete/sources/ultisnips.vim @@ -2,18 +2,33 @@ let s:save_cpo = &cpo set cpo&vim let s:source = { - \ 'name' : 'ultisnips', - \ 'kind' : 'keyword', - \ 'rank' : 8, - \ 'mark' : '[U]', - \} + \ 'name' : 'ultisnips', + \ 'kind' : 'keyword', + \ 'mark' : '[US]', + \ 'rank' : 8, + \ 'matchers' : + \ (g:neocomplete#enable_fuzzy_completion ? + \ ['matcher_fuzzy'] : ['matcher_head']), + \ 'min_pattern_length' : 1, + \ 'max_candidates' : 20, + \ 'is_volatile': 1, + \ } function! s:source.gather_candidates(context) - return keys(UltiSnips#SnippetsInCurrentScope()) + 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 endfunction function! neocomplete#sources#ultisnips#define() - return s:source + return s:source endfunction let &cpo = s:save_cpo diff --git a/doc/UltiSnips.txt b/doc/UltiSnips.txt index 4ee9ddc..bd02579 100644 --- a/doc/UltiSnips.txt +++ b/doc/UltiSnips.txt @@ -1381,6 +1381,7 @@ individuals have contributed to UltiSnips (in chronological order): Gernot Höflechner - LFDM Marcelo D Montu - mMontu Karl Yngve Lervåg - lervag + petobens Thank you for your support.