From e36aef34d43ea5eda535518dcb3baa4cc95d67a0 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Fri, 18 Sep 2015 06:06:30 +0200 Subject: [PATCH] Add custom FoldText function --- after/syntax/vimwiki.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/after/syntax/vimwiki.vim b/after/syntax/vimwiki.vim index 86ed07a..fe42b58 100644 --- a/after/syntax/vimwiki.vim +++ b/after/syntax/vimwiki.vim @@ -28,3 +28,17 @@ syntax match TaskWikiTaskPriority containedin=TaskWikiTask contained /\( !\| !!\ " Set concealed parts as really concealed in normal mode, and with cursor over setlocal conceallevel=3 setlocal concealcursor=nc + +" Configure custom FoldText function +" Altered version of the VimwikiFoldText + +function! TaskwikiFoldText() + let line = getline(v:foldstart) + let main_text = substitute(line, '^\s*', repeat(' ',indent(v:foldstart)), '') + let short_text = substitute(main_text, '|[^=]* =', '=', '') + let fold_len = v:foldend - v:foldstart + 1 + let len_text = ' ['.fold_len.'] ' + return short_text.len_text.repeat(' ', 500) +endfunction + +setlocal foldtext=TaskwikiFoldText()