vim:ftplugin:markdown: Fold by sections

This commit is contained in:
2023-02-13 16:50:50 +01:00
parent 295f33e62c
commit e2a133a29b

View File

@@ -4,3 +4,10 @@ setlocal formatoptions+=aw
" Turn on line-wrapping
setlocal wrap
" Fold by sections
function MdSectionFold()
let depth = len(matchstr(getline(v:lnum), '^#*'))
return depth ? ">" . depth : "="
endfunction
setlocal foldmethod=expr foldexpr=MdSectionFold()