vim/vim/after/syntax/vue.vim

15 lines
950 B
VimL

syn keyword vueComponentTag contained template containedin=htmlSpecialTagName
syn match vueDirective "\s[v:][-:.0-9_a-z]*" containedin=htmlTag,htmlTagN nextgroup=vueDirectiveValue
syn match vueEvent "\s[@][-:.0-9_a-z]*" containedin=htmlTag,htmlTagN nextgroup=vueEventValue
syn match vueConditional "\<v-else" containedin=htmlTag,htmlTagN
syn match vueConditional "\<v-if\|v-show" containedin=htmlTag,htmlTagN nextgroup=vueConditionalValue
syn match vueFor "\<v-for" containedin=htmlTag,htmlTagN nextgroup=vueForValue
syn match vueRef "\s:\?ref" containedin=htmlTag,htmlTagN nextgroup=vueRefValue
syn region vueDirectiveValue contained start=+="+hs=s+2 end=+"+he=e-1
syn region vueEventValue contained start=+="+hs=s+2 end=+"+he=e-1
syn region vueConditionalValue contained start=+="+hs=s+2 end=+"+he=e-1
syn region vueForValue contained start=+="+hs=s+2 end=+"+he=e-1
syn match vueRefValue contained +="[-:.0-9_a-z]*"+hs=s+2,he=e-1