mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2025-12-08 21:54:46 +08:00
feat: add vue directive syntax highlight
This commit is contained in:
32
syntax/vue-html.vim
Normal file
32
syntax/vue-html.vim
Normal file
@@ -0,0 +1,32 @@
|
||||
syntax match VueAttr '\v(\S)@<![v:\@][^\=]+(\=\"[^"]*\")?'
|
||||
\ containedin=htmlTag
|
||||
\ contains=VueKey,VueValue,VueInject
|
||||
|
||||
syntax match VueKey contained '\v[v:\@][^\=]+'
|
||||
syntax match VueValue contains=VueInject contained '\v\"\zs[^"]*\ze\"'
|
||||
syntax match VueInject contained '\v\$\w*'
|
||||
|
||||
syntax region VueExpression
|
||||
\ containedin=vueTemplate,vueValue,htmlString
|
||||
\ matchgroup=VueBrace
|
||||
\ start="{{"
|
||||
\ end="}}"
|
||||
|
||||
syntax region VueExpression
|
||||
\ containedin=htmlItalic
|
||||
\ matchgroup=VueBrace
|
||||
\ transparent
|
||||
\ start="{{"
|
||||
\ end="}}"
|
||||
|
||||
" Wepy directive syntax
|
||||
syntax match VueAttr '\v(\S)@<!wx[^\=]+(\=\"[^"]*\")?'
|
||||
\ containedin=htmlTag
|
||||
\ contains=VueKey,VueValue,VueInject
|
||||
|
||||
syntax match VueKey contained '\vwx[^\=]+'
|
||||
|
||||
highlight link VueAttr Comment
|
||||
highlight link VueKey PreProc
|
||||
highlight link VueInject Constant
|
||||
highlight link VueBrace PreProc
|
||||
Reference in New Issue
Block a user