vim:ftplugin:markdown: Fold by sections
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user