diff --git a/README.md b/README.md index 3a40e55..2784b25 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Since `.vue` is a combination of CSS, HTML and JavaScript, so is `vim-vue-plugin Supports -- Vue attribute(directive). +- Vue attribute(directive).^ - Less/Sass/Scss, Pug with [vim-pug][4], Coffee with [vim-coffee-script][11], TypeScript with [typescript-vim][14] or [yats.vim][15], Stylus with [vim-stylus][16].^ - A builtin `foldexpr` foldmethod.^ - [emmet-vim][10] HTML/CSS/JavaScript filetype detection. @@ -72,11 +72,13 @@ let g:vim_vue_plugin_load_full_syntax = 1 | `g:vim_vue_plugin_has_init_indent` | Initially indent one tab inside `style/script` tags. | 0+ | | `g:vim_vue_plugin_highlight_vue_attr` | Highlight vue attribute value as expression instead of string. | 0 | | `g:vim_vue_plugin_highlight_vue_keyword` | Highlight vue keyword like `data`, `methods`, ... | 0 | -| `g:vim_vue_plugin_use_foldexpr` | Enable builtin `foldexpr` foldmethod. | 0 | +| `g:vim_vue_plugin_use_foldexpr`\# | Enable builtin `foldexpr` foldmethod. | 0 | | `g:vim_vue_plugin_debug` | Echo debug messages in `messages` list. Useful to debug if unexpected indents occur. | 0 | \*: Vim may be slow if the feature is enabled. Find a balance between syntax highlight and speed. By the way, custom syntax can be added in `~/.vim/syntax` or `$VIM/vimfiles/syntax`. +\#: In the case when it's enabled, the `foldexpr` is not efficient for large files, so it's not enabled initially when the line number exceeds `1000`. You can enable it mannully by `setlocal foldmethod=expr` when required. + \+: 0 for `.vue` and 1 for `.wpy` **Note** diff --git a/ftplugin/vue/fold.vim b/ftplugin/vue/fold.vim index e7ff36f..24a48fe 100644 --- a/ftplugin/vue/fold.vim +++ b/ftplugin/vue/fold.vim @@ -13,7 +13,9 @@ if !s:use_foldexpr | finish | endif " Settings {{{ " """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -setlocal foldmethod=expr +if line('$') < 1000 + setlocal foldmethod=expr +endif setlocal foldexpr=GetVueFold(v:lnum) "}}}