mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2025-12-08 05:34:44 +08:00
Use a help function to get user config
This commit is contained in:
@@ -7,3 +7,8 @@ function! vue#Log(msg)
|
|||||||
echom '['.s:name.']['.v:lnum.'] '.a:msg
|
echom '['.s:name.']['.v:lnum.'] '.a:msg
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! vue#GetConfig(name, default)
|
||||||
|
let name = 'g:vim_vue_plugin_'.a:name
|
||||||
|
return exists(name) ? eval(name) : a:default
|
||||||
|
endfunction
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
" Config {{{
|
" Config {{{
|
||||||
"
|
"
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
let s:use_foldexpr = exists("g:vim_vue_plugin_use_foldexpr")
|
let s:use_foldexpr = vue#GetConfig("use_foldexpr", 0)
|
||||||
\ && g:vim_vue_plugin_use_foldexpr == 1
|
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
if !s:use_foldexpr | finish | endif
|
if !s:use_foldexpr | finish | endif
|
||||||
|
|||||||
@@ -33,18 +33,12 @@ let s:tag_end = '\v^\s*\/?\>\s*'
|
|||||||
" Config {{{
|
" Config {{{
|
||||||
"
|
"
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
let s:use_pug = exists("g:vim_vue_plugin_use_pug")
|
let s:use_pug = vue#GetConfig("use_pug", 0)
|
||||||
\ && g:vim_vue_plugin_use_pug == 1
|
let s:use_sass = vue#GetConfig("use_sass", 0)
|
||||||
let s:use_sass = exists("g:vim_vue_plugin_use_sass")
|
let s:use_scss = vue#GetConfig("use_scss", 0)
|
||||||
\ && g:vim_vue_plugin_use_sass == 1
|
let s:use_stylus = vue#GetConfig("use_stylus", 0)
|
||||||
let s:use_scss = exists("g:vim_vue_plugin_use_scss")
|
let s:use_coffee = vue#GetConfig("use_coffee", 0)
|
||||||
\ && g:vim_vue_plugin_use_scss == 1
|
let s:use_typescript = vue#GetConfig("use_typescript", 0)
|
||||||
let s:use_stylus = exists("g:vim_vue_plugin_use_stylus")
|
|
||||||
\ && g:vim_vue_plugin_use_stylus == 1
|
|
||||||
let s:use_coffee = exists("g:vim_vue_plugin_use_coffee")
|
|
||||||
\ && g:vim_vue_plugin_use_coffee == 1
|
|
||||||
let s:use_typescript = exists("g:vim_vue_plugin_use_typescript")
|
|
||||||
\ && g:vim_vue_plugin_use_typescript == 1
|
|
||||||
|
|
||||||
let s:has_init_indent = 0
|
let s:has_init_indent = 0
|
||||||
if !exists("g:vim_vue_plugin_has_init_indent")
|
if !exists("g:vim_vue_plugin_has_init_indent")
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
" Config {{{
|
" Config {{{
|
||||||
"
|
"
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
let s:highlight_vue_attr = exists("g:vim_vue_plugin_highlight_vue_attr")
|
let s:highlight_vue_attr = vue#GetConfig("highlight_vue_attr", 0)
|
||||||
\ && g:vim_vue_plugin_highlight_vue_attr == 1
|
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
" Config {{{
|
" Config {{{
|
||||||
"
|
"
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
let s:highlight_vue_keyword = exists("g:vim_vue_plugin_highlight_vue_keyword")
|
let s:highlight_vue_keyword = vue#GetConfig("highlight_vue_keyword", 0)
|
||||||
\ && g:vim_vue_plugin_highlight_vue_keyword == 1
|
|
||||||
|
|
||||||
if !s:highlight_vue_keyword | finish | endif
|
if !s:highlight_vue_keyword | finish | endif
|
||||||
"}}}
|
"}}}
|
||||||
|
|||||||
@@ -18,22 +18,14 @@ let b:current_loading_main_syntax = 'vue'
|
|||||||
" Config {{{
|
" Config {{{
|
||||||
"
|
"
|
||||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
let s:load_full_syntax = exists("g:vim_vue_plugin_load_full_syntax")
|
let s:load_full_syntax = vue#GetConfig("load_full_syntax", 0)
|
||||||
\ && g:vim_vue_plugin_load_full_syntax == 1
|
let s:use_pug = vue#GetConfig("use_pug", 0)
|
||||||
let s:use_pug = exists("g:vim_vue_plugin_use_pug")
|
let s:use_less = vue#GetConfig("use_less", 0)
|
||||||
\ && g:vim_vue_plugin_use_pug == 1
|
let s:use_sass = vue#GetConfig("use_sass", 0)
|
||||||
let s:use_less = exists("g:vim_vue_plugin_use_less")
|
let s:use_scss = vue#GetConfig("use_scss", 0)
|
||||||
\ && g:vim_vue_plugin_use_less == 1
|
let s:use_stylus = vue#GetConfig("use_stylus", 0)
|
||||||
let s:use_sass = exists("g:vim_vue_plugin_use_sass")
|
let s:use_coffee = vue#GetConfig("use_coffee", 0)
|
||||||
\ && g:vim_vue_plugin_use_sass == 1
|
let s:use_typescript = vue#GetConfig("use_typescript", 0)
|
||||||
let s:use_scss = exists("g:vim_vue_plugin_use_scss")
|
|
||||||
\ && g:vim_vue_plugin_use_scss == 1
|
|
||||||
let s:use_stylus = exists("g:vim_vue_plugin_use_stylus")
|
|
||||||
\ && g:vim_vue_plugin_use_stylus == 1
|
|
||||||
let s:use_coffee = exists("g:vim_vue_plugin_use_coffee")
|
|
||||||
\ && g:vim_vue_plugin_use_coffee == 1
|
|
||||||
let s:use_typescript = exists("g:vim_vue_plugin_use_typescript")
|
|
||||||
\ && g:vim_vue_plugin_use_typescript == 1
|
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
|
|||||||
Reference in New Issue
Block a user