I always used the forldmethod = marker and defined my own tag labels placed in the comments.
it is a definition of characters that define open and closed folds. in this case open is "<(" and close is ")>" replace them with what you want.
set foldmethod=marker set foldmarker=<(,)>
This is my custom function to decide what to display folded text:
set foldtext=GetCustomFoldText() function GetCustomFoldText() let preline = substitute(getline(v:foldstart),'<(','<(+)','') let line = substitute(preline,"\t",' ','g') let nextLnNum = v:foldstart + 1 let nextline = getline(nextLnNum) let foldTtl = v:foldend - v:foldstart return line . ' | ' . nextline . ' (' . foldTtl . ' lines)>' endfunction
Hope this helps.
source share