mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2025-12-08 21:54:46 +08:00
refact: use full command name
This commit is contained in:
@@ -41,14 +41,14 @@ endfunction
|
|||||||
|
|
||||||
function! s:LoadDefaultSyntax(group, type)
|
function! s:LoadDefaultSyntax(group, type)
|
||||||
unlet! b:current_syntax
|
unlet! b:current_syntax
|
||||||
exec 'syn include '.a:group.' $VIMRUNTIME/syntax/'.a:type.'.vim'
|
execute 'syntax include '.a:group.' $VIMRUNTIME/syntax/'.a:type.'.vim'
|
||||||
exec 'silent! syn include '.a:group.' $VIM/vimfiles/syntax/'.a:type.'.vim'
|
execute 'silent! syntax include '.a:group.' $VIM/vimfiles/syntax/'.a:type.'.vim'
|
||||||
exec 'silent! syn include '.a:group.' $HOME/.vim/syntax/'.a:type.'.vim'
|
execute 'silent! syntax include '.a:group.' $HOME/.vim/syntax/'.a:type.'.vim'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:LoadFullSyntax(group, type)
|
function! s:LoadFullSyntax(group, type)
|
||||||
unlet! b:current_syntax
|
unlet! b:current_syntax
|
||||||
exec 'syn include '.a:group.' syntax/'.a:type.'.vim'
|
execute 'syntax include '.a:group.' syntax/'.a:type.'.vim'
|
||||||
endfunction
|
endfunction
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
@@ -59,6 +59,7 @@ endfunction
|
|||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
" Load syntax/*.vim to syntax group
|
" Load syntax/*.vim to syntax group
|
||||||
call s:LoadSyntax('@HTMLSyntax', 'html')
|
call s:LoadSyntax('@HTMLSyntax', 'html')
|
||||||
|
runtime syntax/vue-html.vim
|
||||||
|
|
||||||
" Avoid overload
|
" Avoid overload
|
||||||
if hlexists('cssTagName') == 0
|
if hlexists('cssTagName') == 0
|
||||||
@@ -93,10 +94,10 @@ endif
|
|||||||
|
|
||||||
" Redefine syn-region to color correctly.
|
" Redefine syn-region to color correctly.
|
||||||
if s:use_sass || s:use_less
|
if s:use_sass || s:use_less
|
||||||
syn region lessDefinition transparent matchgroup=cssBraces contains=@LessSyntax
|
syntax region lessDefinition transparent matchgroup=cssBraces contains=@LessSyntax
|
||||||
\ start="{"
|
\ start="{"
|
||||||
\ end="}"
|
\ end="}"
|
||||||
syn region sassDefinition transparent matchgroup=cssBraces contains=@SassSyntax
|
syntax region sassDefinition transparent matchgroup=cssBraces contains=@SassSyntax
|
||||||
\ start="{"
|
\ start="{"
|
||||||
\ end="}"
|
\ end="}"
|
||||||
endif
|
endif
|
||||||
@@ -107,52 +108,52 @@ endif
|
|||||||
" Syntax highlight {{{
|
" Syntax highlight {{{
|
||||||
"
|
"
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
syn region vueTemplate
|
syntax region vueTemplate
|
||||||
\ start=+<template\(\s.\{-}\)\?>+
|
\ start=+<template\(\s.\{-}\)\?>+
|
||||||
\ end=+^</template>+
|
\ end=+^</template>+
|
||||||
\ keepend contains=@HTMLSyntax
|
\ keepend contains=@HTMLSyntax
|
||||||
syn region vueTemplatePug
|
syntax region vueTemplatePug
|
||||||
\ start=+<template lang="pug"\(\s.\{-}\)\?>+
|
\ start=+<template lang="pug"\(\s.\{-}\)\?>+
|
||||||
\ end=+</template>+
|
\ end=+</template>+
|
||||||
\ keepend contains=@PugSyntax,vueTag
|
\ keepend contains=@PugSyntax,vueTag
|
||||||
|
|
||||||
syn region vueScript
|
syntax region vueScript
|
||||||
\ start=+<script\(\s.\{-}\)\?>+
|
\ start=+<script\(\s.\{-}\)\?>+
|
||||||
\ end=+</script>+
|
\ end=+</script>+
|
||||||
\ keepend contains=@jsAll,jsImport,jsExport,vueTag
|
\ keepend contains=@jsAll,jsImport,jsExport,vueTag
|
||||||
|
|
||||||
syn region vueStyle
|
syntax region vueStyle
|
||||||
\ start=+<style\(\s.\{-}\)\?>+
|
\ start=+<style\(\s.\{-}\)\?>+
|
||||||
\ end=+</style>+
|
\ end=+</style>+
|
||||||
\ keepend contains=@htmlCss,vueTag
|
\ keepend contains=@htmlCss,vueTag
|
||||||
syn region vueStyleLESS
|
syntax region vueStyleLESS
|
||||||
\ start=+<style lang="less"\(\s.\{-}\)\?>+
|
\ start=+<style lang="less"\(\s.\{-}\)\?>+
|
||||||
\ end=+</style>+
|
\ end=+</style>+
|
||||||
\ keepend contains=@LessSyntax,vueTag
|
\ keepend contains=@LessSyntax,vueTag
|
||||||
syn region vueStyleSASS
|
syntax region vueStyleSASS
|
||||||
\ start=+<style lang="sass"\(\s.\{-}\)\?>+
|
\ start=+<style lang="sass"\(\s.\{-}\)\?>+
|
||||||
\ end=+</style>+
|
\ end=+</style>+
|
||||||
\ keepend contains=@SassSyntax,vueTag
|
\ keepend contains=@SassSyntax,vueTag
|
||||||
syn region vueStyleSCSS
|
syntax region vueStyleSCSS
|
||||||
\ start=+<style lang="scss"\(\s.\{-}\)\?>+
|
\ start=+<style lang="scss"\(\s.\{-}\)\?>+
|
||||||
\ end=+</style>+
|
\ end=+</style>+
|
||||||
\ keepend contains=@SassSyntax,vueTag
|
\ keepend contains=@SassSyntax,vueTag
|
||||||
|
|
||||||
syn region vueTag
|
syntax region vueTag
|
||||||
\ start=+<[^/]+ end=+>+
|
\ start=+<[^/]+ end=+>+
|
||||||
\ contained contains=htmlTagN,htmlString,htmlArg fold
|
\ contained contains=htmlTagN,htmlString,htmlArg fold
|
||||||
syn region vueTag
|
syntax region vueTag
|
||||||
\ start=+</+ end=+>+
|
\ start=+</+ end=+>+
|
||||||
\ contained contains=htmlTagN,htmlString,htmlArg
|
\ contained contains=htmlTagN,htmlString,htmlArg
|
||||||
" syn keyword vueTagName containedin=htmlTagN template script style
|
" syn keyword vueTagName containedin=htmlTagN template script style
|
||||||
|
|
||||||
" Vue attributes should color as JS. Note the trivial end pattern; we let
|
" Vue attributes should color as JS. Note the trivial end pattern; we let
|
||||||
" jsBlock take care of ending the region.
|
" jsBlock take care of ending the region.
|
||||||
syn region xmlString
|
syntax region xmlString
|
||||||
\ start=+{+ end=++
|
\ start=+{+ end=++
|
||||||
\ contained contains=jsBlock,javascriptBlock
|
\ contained contains=jsBlock,javascriptBlock
|
||||||
|
|
||||||
hi def link vueTag htmlTag
|
highlight def link vueTag htmlTag
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
let b:current_syntax = 'vue'
|
let b:current_syntax = 'vue'
|
||||||
|
|||||||
Reference in New Issue
Block a user