feat: change vue AttrKey highlight link to 'Type'

This commit is contained in:
yemai
2019-06-14 12:21:20 +08:00
parent c822a02305
commit 011169653d
3 changed files with 16 additions and 10 deletions

View File

@@ -1,10 +1,12 @@
syntax match VueComponentName containedin=htmlTagN '\v<[a-zA-Z0-9]+(-[a-zA-Z0-9]+)+>'
syntax match VueAttr '\v(\S)@<![v:\@][^\=]+(\=\"[^"]*\")?'
syntax match VueAttr '\v(\S)@<![v:\@][^\=]*(\=\"[^"]*\")?'
\ containedin=htmlTag
\ contains=VueKey,VueValue,VueInject
\ contains=VueKey,VueValue
syntax match VueKey contained '\v[v:\@][^\=]+' keepend
syntax match VueValue contained '\v\"\zs[^"]*\ze\"'
\ contains=VueInject,javaScriptStringS,javaScriptRepeat
syntax match VueKey contained '\v[v:\@][^\=]+'
syntax match VueValue contains=VueInject contained '\v\"\zs[^"]*\ze\"'
syntax match VueInject contained '\v\$\w*'
syntax region VueExpression
@@ -15,7 +17,8 @@ syntax region VueExpression
\ end="}}"
syntax region VueExpression
\ containedin=vueTemplate,vueValue,htmlString
\ containedin=vueTemplate,VueValue,htmlString,htmlValue
\ contains=@jsAll
\ matchgroup=VueBrace
\ start="{{"
\ end="}}"
@@ -28,7 +31,7 @@ syntax match VueAttr '\v(\S)@<!wx[^\=]+(\=\"[^"]*\")?'
syntax match VueKey contained '\vwx[^\=]+'
highlight link VueAttr Comment
highlight link VueKey PreProc
highlight link VueKey Type
highlight link VueInject Constant
highlight link VueBrace PreProc
highlight link VueBrace Type
highlight link VueComponentName Statement