commit 6277d49ac1f359eecc48b95bfa9998565e19f614 parent 2a742d25a35073653cf992908e8496a3a5170867 Author: Alex Balgavy <alex@balgavy.eu> Date: Fri, 4 Dec 2020 11:36:33 +0100 vim: set up vimtex folding Former-commit-id: d3986cd04ef2fabf5fc6354a06ee348f6540bba9 Diffstat:
M | vim/after/ftplugin/tex.vim | | | 7 | ++++++- |
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/vim/after/ftplugin/tex.vim b/vim/after/ftplugin/tex.vim @@ -8,7 +8,12 @@ inoremap <buffer> : :<c-g>u inoremap <buffer> ; ;<c-g>u inoremap <buffer> - -<c-g>u setlocal formatoptions-=cat wrap + +" Set up folding. By default use indent, fdm=expr can be set in modeline. +setlocal foldmethod=indent +setlocal foldexpr=vimtex#fold#level(v:lnum) +setlocal foldtext=vimtex#fold#text() let b:undo_ftplugin = (exists('b:undo_ftplugin') ? b:undo_ftplugin.'|' : '') let b:undo_ftplugin .= 'nmapc <buffer>' let b:undo_ftplugin .= '|imapc <buffer>' -let b:undo_ftplugin .= '|setlocal formatoptions< wrap<' +let b:undo_ftplugin .= '|setlocal formatoptions< wrap< foldmethod< foldexpr< foldtext<'