diff --git a/README.md b/README.md index 966188e..f29206b 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/autoload/vue.vim b/autoload/vue.vim index 1af02b6..e95086a 100644 --- a/autoload/vue.vim +++ b/autoload/vue.vim @@ -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 diff --git a/indent/vue.vim b/indent/vue.vim index 50d8072..668b654 100644 --- a/indent/vue.vim +++ b/indent/vue.vim @@ -1,3 +1,7 @@ +" Language: Vue +" Maintainer: leaf +" CREDITS: Inspired by mxw/vim-jsx. + if exists('b:did_indent') | finish |endif function! s:Init() diff --git a/syntax/vue.vim b/syntax/vue.vim index 73a0b2f..62e8e74 100644 --- a/syntax/vue.vim +++ b/syntax/vue.vim @@ -1,3 +1,7 @@ +" Language: Vue +" Maintainer: leaf +" CREDITS: Inspired by mxw/vim-jsx. + if exists('b:current_syntax') && b:current_syntax == 'vue' finish endif