Update doc/message

This commit is contained in:
leafOfTree
2021-03-29 17:31:39 +08:00
parent 258d30fc6b
commit d90b18e1c7
4 changed files with 41 additions and 3 deletions

View File

@@ -96,7 +96,7 @@ Now we use `g:vim_vue_plugin_config` as the only configuration variable.
- `value`*list*: a list of syntax name for the block.
- First, only syntax files from `['$VIMRUNTIME', '$VIM/vimfiles', '$HOME/.vim']` are loaded. If none is found, then **full** syntax files (including those from plugins) will be loaded
- The first item of `value` will be used as default syntax when no `lang="..."` appears on the block tag. 'value' can be a string if only one.
- The first item of `value` will be used as default syntax when no `lang="..."` appears on the block tag. `value` can be string if only one.
- Both Vue blocks and custom blocks are supported.
- `full_syntax`*list*: a list of syntax name whose **full** syntax files are always loaded
@@ -107,6 +107,8 @@ Now we use `g:vim_vue_plugin_config` as the only configuration variable.
- `foldexpr`*0/1*: enable built-in `foldexpr` foldmethod
- `init_indent`*0/1*: enable initial one tab indent inside `script/style` tags
- `debug`*0/1*: echo debug messages in `messages` list
> For `0/1` value, set `0` to enable or `1` to disable

View File

@@ -39,8 +39,36 @@ endfunction
function! s:CheckVersion()
if !exists('g:vim_vue_plugin_config')
let message = 'Please check README.md or https://github.com/leafOfTree/vim-vue-plugin'
echom '['.s:name.'] '.message
let prev_configs = [
\'g:vim_vue_plugin_load_full_syntax',
\'g:vim_vue_plugin_use_pug',
\'g:vim_vue_plugin_use_coffee',
\'g:vim_vue_plugin_use_typescript',
\'g:vim_vue_plugin_use_less',
\'g:vim_vue_plugin_use_sass',
\'g:vim_vue_plugin_use_scss',
\'g:vim_vue_plugin_use_stylus',
\'g:vim_vue_plugin_has_init_indent',
\'g:vim_vue_plugin_highlight_vue_attr',
\'g:vim_vue_plugin_highlight_vue_keyword',
\'g:vim_vue_plugin_use_foldexpr',
\'g:vim_vue_plugin_custom_blocks',
\'g:vim_vue_plugin_debug',
\]
let has_prev_config = 0
for config in prev_configs
if exists(config)
let has_prev_config = 1
break
endif
endfor
if has_prev_config
let message = 'Hey, it seems that you just upgraded. Please use `g:vim_vue_plugin_config` to replace previous configs'
let message2 = 'For details, please check README.md ## Configuration or https://github.com/leafOfTree/vim-vue-plugin'
echom '['.s:name.'] '.message
echom '['.s:name.'] '.message2
endif
endif
endfunction

View File

@@ -1,3 +1,7 @@
" Language: Vue
" Maintainer: leaf <https://github.com/leafOfTree>
" CREDITS: Inspired by mxw/vim-jsx.
if exists('b:did_indent') | finish |endif
function! s:Init()

View File

@@ -1,3 +1,7 @@
" Language: Vue
" Maintainer: leaf <https://github.com/leafOfTree>
" CREDITS: Inspired by mxw/vim-jsx.
if exists('b:current_syntax') && b:current_syntax == 'vue'
finish
endif