Add option vimtex_fold_section_character for custom fold characters (#472)
* Add option g:vimtex_fold_section_character for custom fold characters * Add changes from codereview
This commit is contained in:
parent
456de02119
commit
36442d4c4f
@ -8,6 +8,7 @@ function! vimtex#fold#init_options() " {{{1
|
|||||||
call vimtex#util#set_default('g:vimtex_fold_enabled', 0)
|
call vimtex#util#set_default('g:vimtex_fold_enabled', 0)
|
||||||
call vimtex#util#set_default('g:vimtex_fold_manual', 0)
|
call vimtex#util#set_default('g:vimtex_fold_manual', 0)
|
||||||
call vimtex#util#set_default('g:vimtex_fold_comments', 0)
|
call vimtex#util#set_default('g:vimtex_fold_comments', 0)
|
||||||
|
call vimtex#util#set_default('g:vimtex_fold_section_character', '')
|
||||||
call vimtex#util#set_default('g:vimtex_fold_preamble', 1)
|
call vimtex#util#set_default('g:vimtex_fold_preamble', 1)
|
||||||
call vimtex#util#set_default('g:vimtex_fold_envs', 1)
|
call vimtex#util#set_default('g:vimtex_fold_envs', 1)
|
||||||
call vimtex#util#set_default('g:vimtex_fold_parts',
|
call vimtex#util#set_default('g:vimtex_fold_parts',
|
||||||
@ -234,7 +235,14 @@ endfunction
|
|||||||
function! vimtex#fold#text() " {{{1
|
function! vimtex#fold#text() " {{{1
|
||||||
" Initialize
|
" Initialize
|
||||||
let line = getline(v:foldstart)
|
let line = getline(v:foldstart)
|
||||||
let level = v:foldlevel > 1 ? repeat('-', v:foldlevel-2) . '*' : ''
|
|
||||||
|
if empty(g:vimtex_fold_section_character)
|
||||||
|
let fold_character = '*'
|
||||||
|
else
|
||||||
|
let fold_character = g:vimtex_fold_section_character
|
||||||
|
endif
|
||||||
|
|
||||||
|
let level = v:foldlevel > 1 ? repeat('-', v:foldlevel-2) . fold_character : ''
|
||||||
let title = 'Not defined'
|
let title = 'Not defined'
|
||||||
let nt = 73
|
let nt = 73
|
||||||
|
|
||||||
|
@ -427,6 +427,12 @@ Options~
|
|||||||
|
|
||||||
Default value: 0
|
Default value: 0
|
||||||
|
|
||||||
|
*g:vimtex_fold_section_character*
|
||||||
|
|
||||||
|
Use custom section symbol for folding.
|
||||||
|
|
||||||
|
Default value: ''
|
||||||
|
|
||||||
*g:vimtex_fold_envs*
|
*g:vimtex_fold_envs*
|
||||||
Control whether or not to fold environments.
|
Control whether or not to fold environments.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user