From 01e9ab6c03f40079540171fd61ec792757e978c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Fri, 25 Jul 2014 08:24:01 +0200 Subject: [PATCH] Also remap zX for folding --- autoload/latex/fold.vim | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/autoload/latex/fold.vim b/autoload/latex/fold.vim index f63a6fb..7e38a3f 100644 --- a/autoload/latex/fold.vim +++ b/autoload/latex/fold.vim @@ -13,13 +13,14 @@ function! latex#fold#init(initialized) " {{{1 setl foldtext=latex#fold#text() " Initalize folds - call latex#fold#refresh() + call latex#fold#refresh('zx') " Remap zx to refresh fold levels - nnoremap zx :call latex#fold#refresh() + nnoremap zx :call latex#fold#refresh('zx') + nnoremap zX :call latex#fold#refresh('zX') " Define commands and maps - command! -buffer VimLatexRefreshFolds call latex#fold#refresh() + command! -buffer VimLatexRefreshFolds call latex#fold#refresh('zx') " Set options for automatic/manual mode if g:latex_fold_automatic @@ -42,16 +43,16 @@ function! latex#fold#init(initialized) " {{{1 endif endfunction -function! latex#fold#refresh() " {{{1 +function! latex#fold#refresh(map) " {{{1 " Parse tex file to dynamically set the sectioning fold levels let b:latex.fold_parts = s:find_fold_parts() " Refresh folds if g:latex_fold_automatic - normal! zx + execute 'normal! ' . a:map else setl foldmethod=expr - normal! zx + execute 'normal! ' . a:map setl foldmethod=manual endif endfunction