From ba2f30fdf943f73072ba31f45231a2ed02aa7841 Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Thu, 6 Mar 2014 06:47:55 +0100 Subject: [PATCH] Adapted neosnippets source. Examples by petobens. --- autoload/neocomplete/sources/ultisnips.vim | 29 ++++++++++++++++------ doc/UltiSnips.txt | 1 + 2 files changed, 23 insertions(+), 7 deletions(-) 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.