vim - a piece of code to find code folding
给我你的怀抱
给我你的怀抱 2017-05-16 16:41:57
0
1
720

Existing piece of folding code:

set fdm=expr
set foldexpr=Myindent(v:lnum)
func! Myindent(lnum)
    let s:a=strlen(matchstr(getline(v:lnum), '^\*\+\s\+\|^\d\(\.\d\)\=\s\+'))
    if s:a == 4
        return '>2'
    elseif s:a == 2
        return '>1'
    else
        return '='
    endif
endf

Text before folding:

Existing folding effects:

My needs:

  1. As shown in the picture below, how to remove the excess part in the front? It will look cleaner if you remove it
  2. I just started to contact Vim, I hope you can give me some advice

给我你的怀抱
给我你的怀抱

reply all(1)
迷茫
:help fold-foldtext
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!