diff --git a/autoload/unite/sources/ultisnips.vim b/autoload/unite/sources/ultisnips.vim index 58b94c0..1ded37f 100644 --- a/autoload/unite/sources/ultisnips.vim +++ b/autoload/unite/sources/ultisnips.vim @@ -5,6 +5,7 @@ let s:unite_source = { \ 'name': 'ultisnips', \ 'hooks': {}, \ 'action_table': {}, + \ 'syntax' : 'uniteSource__Ultisnips', \ 'default_action': 'expand', \ } @@ -13,6 +14,20 @@ let s:unite_source.action_table.preview = { \ 'is_quit' : 0, \ } +function! s:unite_source.hooks.on_syntax(args, context) abort + syntax case ignore + syntax match uniteSource__UltisnipsHeader /^.*$/ + \ containedin=uniteSource__Ultisnips + syntax match uniteSource__UltisnipsTrigger /\v^\s.{-}\ze\s/ contained + \ containedin=uniteSource__UltisnipsHeader + \ nextgroup=uniteSource__UltisnipsDescription + syntax match uniteSource__UltisnipsDescription /\v.{3}\s\zs\w.*$/ contained + \ containedin=uniteSource__UltisnipsHeader + + highlight default link uniteSource__UltisnipsTrigger Identifier + highlight default link uniteSource__UltisnipsDescription Statement +endfunction + function! s:unite_source.action_table.preview.func(candidate) " no nice preview at this point, cannot get snippet text let snippet_preview = a:candidate['word']