From 20357fd930aa1f69e3938a4e2212794ae36c3828 Mon Sep 17 00:00:00 2001 From: ManjaroOne666 Date: Thu, 1 Feb 2018 20:39:14 +0000 Subject: [PATCH] more vue syntax highlighting --- vim/colors/customred256.vim | 6 ++++++ vim/syntax/vue_custom.vim | 20 ++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/vim/colors/customred256.vim b/vim/colors/customred256.vim index 260645b..ea364cb 100644 --- a/vim/colors/customred256.vim +++ b/vim/colors/customred256.vim @@ -256,6 +256,12 @@ hi! vueConditional ctermfg=202 hi! def link vueFor vueConditional hi! vueRef ctermfg=214 +hi! vueDirectiveValue ctermfg=201 +hi! vueEventValue ctermfg=201 +hi! vueConditionalValue ctermfg=201 +hi! vueForValue ctermfg=201 +hi! vueRefValue ctermfg=201 + " json definitions hi! def link jsonKeyword Identifier hi! def link jsonValue String diff --git a/vim/syntax/vue_custom.vim b/vim/syntax/vue_custom.vim index a4a85e0..3801dab 100644 --- a/vim/syntax/vue_custom.vim +++ b/vim/syntax/vue_custom.vim @@ -56,11 +56,19 @@ endif syn region vueSurroundingTag contained start=+<\(script\|style\|template\)+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent syn keyword htmlSpecialTagName contained template syn keyword htmlArg contained scoped ts -" syn match htmlArg "[@v:][-:.0-9_a-z]*\>" contained -syn match vueDirective "[v:][-:.0-9_a-z]*" containedin=htmlTag -syn match vueEvent "[@][-:.0-9_a-z]*" containedin=htmlTag -syn match vueConditional "v-if\|v-else\|v-show" containedin=htmlTag -syn match vueFor "v-for" containedin=htmlTag -syn match vueRef "ref" containedin=htmlTag + + +syn match vueDirective "[v:][-:.0-9_a-z]*" containedin=htmlTag nextgroup=vueDirectiveValue +syn match vueEvent "[@][-:.0-9_a-z]*" containedin=htmlTag nextgroup=vueEventValue +syn match vueConditional "v-else" containedin=htmlTag +syn match vueConditional "v-if\|v-show" containedin=htmlTag nextgroup=vueConditionalValue +syn match vueFor "v-for" containedin=htmlTag nextgroup=vueForValue +syn match vueRef "ref" containedin=htmlTag 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 region vueRefValue contained start=+="+hs=s+2 end=+"+he=e-1 let b:current_syntax = "vue"