syntax highlight for unite ultisnips
This commit is contained in:
parent
5a2dcc5cbf
commit
3a70765f40
@ -5,6 +5,7 @@ let s:unite_source = {
|
|||||||
\ 'name': 'ultisnips',
|
\ 'name': 'ultisnips',
|
||||||
\ 'hooks': {},
|
\ 'hooks': {},
|
||||||
\ 'action_table': {},
|
\ 'action_table': {},
|
||||||
|
\ 'syntax' : 'uniteSource__Ultisnips',
|
||||||
\ 'default_action': 'expand',
|
\ 'default_action': 'expand',
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
@ -13,6 +14,20 @@ let s:unite_source.action_table.preview = {
|
|||||||
\ 'is_quit' : 0,
|
\ '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)
|
function! s:unite_source.action_table.preview.func(candidate)
|
||||||
" no nice preview at this point, cannot get snippet text
|
" no nice preview at this point, cannot get snippet text
|
||||||
let snippet_preview = a:candidate['word']
|
let snippet_preview = a:candidate['word']
|
||||||
|
Loading…
Reference in New Issue
Block a user