better foldtext

This commit is contained in:
ManjaroOne666 2018-05-03 12:47:51 +01:00
parent 5578dc77d0
commit 087a57c7b1
1 changed files with 4 additions and 5 deletions

View File

@ -63,12 +63,11 @@ set mouse=a
set listchars=eol,tab:->,trail:~,extends:>,precedes:<,space
" set foldtext=getline(v:lnum)
set foldtext=MyFoldText()
function MyFoldText()
let line = getline(v:foldstart)
let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
return v:folddashes . sub
function! MyFoldText()
let l:linecount = v:foldend - v:foldstart - 1
let l:line = getline(v:foldstart)
return v:folddashes . ' ' . l:line . ' |+' . l:linecount . '|'
endfunction