chore: use 'marker' fold method

This commit is contained in:
yemai
2019-05-27 10:58:13 +08:00
parent 6b103c5f7c
commit e293511d9e
2 changed files with 23 additions and 10 deletions

View File

@@ -13,7 +13,7 @@ endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" "
" Variables " Variables {{{
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let s:name = 'vim-vue-plugin' let s:name = 'vim-vue-plugin'
@@ -21,10 +21,11 @@ let s:name = 'vim-vue-plugin'
let s:vue_tag = '\v^\<(script|style)' let s:vue_tag = '\v^\<(script|style)'
let s:vue_end_tag = '\v\<\/(template|script|style)' let s:vue_end_tag = '\v\<\/(template|script|style)'
let s:end_tag = '^\s*\/\?>\s*' let s:end_tag = '^\s*\/\?>\s*'
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" "
" Config " Config {{{
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let s:debug = exists("g:vim_vue_plugin_debug") let s:debug = exists("g:vim_vue_plugin_debug")
@@ -42,10 +43,11 @@ if !exists("g:vim_vue_plugin_has_init_indent")
elseif g:vim_vue_plugin_has_init_indent == 1 elseif g:vim_vue_plugin_has_init_indent == 1
let s:has_init_indent = 1 let s:has_init_indent = 1
endif endif
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" "
" Load indent method " Load indent method {{{
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
unlet! b:did_indent unlet! b:did_indent
@@ -67,10 +69,11 @@ if s:use_sass
unlet! b:did_indent unlet! b:did_indent
runtime! indent/sass.vim runtime! indent/sass.vim
endif endif
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" "
" Settings " Settings {{{
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
setlocal sw=2 ts=2 setlocal sw=2 ts=2
@@ -79,10 +82,11 @@ setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e
" XML indentkeys " XML indentkeys
setlocal indentkeys+=*<Return>,<>>,<<>,/ setlocal indentkeys+=*<Return>,<>>,<<>,/
setlocal indentexpr=GetVueIndent() setlocal indentexpr=GetVueIndent()
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" "
" Functions " Functions {{{
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! GetVueIndent() function! GetVueIndent()
@@ -189,5 +193,7 @@ function! LogMsg(msg)
echom '['.s:name.']['.v:lnum.'] '.a:msg echom '['.s:name.']['.v:lnum.'] '.a:msg
endif endif
endfunction endfunction
"}}}
let b:did_indent = 1 let b:did_indent = 1
" vim: fdm=marker

View File

@@ -13,7 +13,7 @@ endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" "
" Config " Config {{{
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let s:load_full_syntax = exists("g:vim_vue_plugin_load_full_syntax") let s:load_full_syntax = exists("g:vim_vue_plugin_load_full_syntax")
@@ -24,10 +24,11 @@ let s:use_less = exists("g:vim_vue_plugin_use_less")
\ && g:vim_vue_plugin_use_less == 1 \ && g:vim_vue_plugin_use_less == 1
let s:use_sass = exists("g:vim_vue_plugin_use_sass") let s:use_sass = exists("g:vim_vue_plugin_use_sass")
\ && g:vim_vue_plugin_use_sass == 1 \ && g:vim_vue_plugin_use_sass == 1
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" "
" Functions " Functions {{{
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! s:LoadSyntax(group, type) function! s:LoadSyntax(group, type)
@@ -49,10 +50,11 @@ function! s:LoadFullSyntax(group, type)
unlet! b:current_syntax unlet! b:current_syntax
exec 'syn include '.a:group.' syntax/'.a:type.'.vim' exec 'syn include '.a:group.' syntax/'.a:type.'.vim'
endfunction endfunction
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" "
" Load main syntax " Load main syntax {{{
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Load syntax/*.vim to syntax group " Load syntax/*.vim to syntax group
@@ -67,10 +69,11 @@ endif
if hlexists('jsNoise') == 0 if hlexists('jsNoise') == 0
call s:LoadSyntax('@jsAll', 'javascript') call s:LoadSyntax('@jsAll', 'javascript')
endif endif
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" "
" Load pre-processors syntax " Load pre-processors syntax {{{
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" If pug is enabled, load vim-pug syntax " If pug is enabled, load vim-pug syntax
@@ -88,6 +91,7 @@ if s:use_less
call s:LoadSyntax('@LessSyntax', 'less') call s:LoadSyntax('@LessSyntax', 'less')
endif endif
" 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 syn region lessDefinition transparent matchgroup=cssBraces contains=@LessSyntax
\ start="{" \ start="{"
@@ -96,10 +100,11 @@ if s:use_sass || s:use_less
\ start="{" \ start="{"
\ end="}" \ end="}"
endif endif
"}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" "
" Syntax highlight " Syntax highlight {{{
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Find tag <template> / <script> / <style> and enable currespond syntax " Find tag <template> / <script> / <style> and enable currespond syntax
@@ -149,5 +154,7 @@ syn region xmlString
\ contained contains=jsBlock,javascriptBlock \ contained contains=jsBlock,javascriptBlock
hi def link vueTag htmlTag hi def link vueTag htmlTag
"}}}
let b:current_syntax = 'vue' let b:current_syntax = 'vue'
" vim: fdm=marker