vim/vim/after/syntax/vue.vim

20 lines
1.3 KiB
VimL

syn keyword vueComponentTag contained template containedin=htmlSpecialTagName
syn match vueDirective "\(^\|\s\)\zs[v:][-:.0-9_a-z]*" containedin=htmlTag,htmlTagN nextgroup=vueDirectiveValue
syn match vueEvent "\(^\|\s\)\zs[@][-:.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\)\zs:\?ref" containedin=htmlTag,htmlTagN nextgroup=vueRefValue
syn region vueDirectiveValue contained start=+="+hs=s+2 end=+"+he=e-1
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 vueEventValue contained start=+='+hs=s+2 end=+'+he=e-1
syn region vueConditionalValue 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 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
syn match vueRefValue contained +='[-:.0-9_a-z]*'+hs=s+2,he=e-1