diff --git a/readme.md b/readme.md index 79e45a1..7b65c7e 100644 --- a/readme.md +++ b/readme.md @@ -130,3 +130,9 @@ let g:vue_pre_processors = [] ``` Available pre-processors are: coffee, haml, handlebars, less, pug, sass, scss, slm, stylus, typescript + +When `g:vue_pre_processors` is set to 'detect_on_enter' instead of a list, vim-vue will detect the pre-processors used when a file is opened, and load only their syntax files. + +```vim +let g:vue_pre_processors = 'detect_on_enter' +``` diff --git a/syntax/vue.vim b/syntax/vue.vim index 5403f3f..e93946a 100644 --- a/syntax/vue.vim +++ b/syntax/vue.vim @@ -31,7 +31,7 @@ function! s:should_register(language, start_pattern) if exists('g:vue_pre_processors') if type(g:vue_pre_processors) == v:t_list return index(g:vue_pre_processors, s:language.name) != -1 - elseif g:vue_pre_processors is# 'auto' + elseif g:vue_pre_processors is# 'detect_on_enter' return search(a:start_pattern, 'n') != 0 endif endif