Added option for folding of usepackage (#477)
This commit is contained in:
parent
3dc482db10
commit
3ec4b49656
@ -26,6 +26,7 @@ function! vimtex#fold#init_options() " {{{1
|
||||
\ 'subsection',
|
||||
\ 'subsubsection',
|
||||
\ ])
|
||||
call vimtex#util#set_default('g:vimtex_fold_usepackage', 1)
|
||||
|
||||
" Disable manual mode in vimdiff
|
||||
let g:vimtex_fold_manual = &diff ? 0 : g:vimtex_fold_manual
|
||||
@ -140,6 +141,7 @@ function! vimtex#fold#level(lnum) " {{{1
|
||||
endif
|
||||
|
||||
" Fold usepackages
|
||||
if g:vimtex_fold_usepackage
|
||||
if line =~# '^\s*\\usepackage\s*\[\s*\%($\|%\)'
|
||||
let s:usepackage = 1
|
||||
return 'a1'
|
||||
@ -147,6 +149,7 @@ function! vimtex#fold#level(lnum) " {{{1
|
||||
let s:usepackage = 0
|
||||
return 's1'
|
||||
endif
|
||||
endif
|
||||
|
||||
" Fold chapters and sections
|
||||
for [part, level] in b:vimtex_fold.parts
|
||||
|
@ -467,6 +467,18 @@ Options~
|
||||
\ "subsubsection",
|
||||
\ ]
|
||||
<
|
||||
*g:vimtex_fold_usepackage*
|
||||
Use this option to disable/enable folding of long `\usepackage` lines. The
|
||||
lines must be formatted like this for folding to work properly: >
|
||||
|
||||
\usepackage[
|
||||
option 1,
|
||||
...,
|
||||
option n
|
||||
]{name}
|
||||
<
|
||||
Default value: 1
|
||||
|
||||
*g:vimtex_imaps_enabled*
|
||||
Use this option to disable/enable the insert mode mappings.
|
||||
|
||||
@ -1584,6 +1596,7 @@ Associated settings:
|
||||
|g:vimtex_fold_parts|
|
||||
|g:vimtex_fold_sections|
|
||||
|g:vimtex_fold_envs|
|
||||
|g:vimtex_fold_usepackage|
|
||||
|
||||
==============================================================================
|
||||
INDENTATION *vimtex-indent*
|
||||
|
Loading…
Reference in New Issue
Block a user