mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2025-12-10 06:31:51 +08:00
Enable fodexpr initially when the line number is less than 1000
This commit is contained in:
@@ -43,7 +43,7 @@ Since `.vue` is a combination of CSS, HTML and JavaScript, so is `vim-vue-plugin
|
|||||||
|
|
||||||
Supports
|
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].^
|
- 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.^
|
- A builtin `foldexpr` foldmethod.^
|
||||||
- [emmet-vim][10] HTML/CSS/JavaScript filetype detection.
|
- [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_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_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_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 |
|
| `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`.
|
\*: 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`
|
\+: 0 for `.vue` and 1 for `.wpy`
|
||||||
|
|
||||||
**Note**
|
**Note**
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ if !s:use_foldexpr | finish | endif
|
|||||||
" Settings {{{
|
" Settings {{{
|
||||||
"
|
"
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
setlocal foldmethod=expr
|
if line('$') < 1000
|
||||||
|
setlocal foldmethod=expr
|
||||||
|
endif
|
||||||
setlocal foldexpr=GetVueFold(v:lnum)
|
setlocal foldexpr=GetVueFold(v:lnum)
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user