vim:ftplug:vimwiki: Copy markdown section folding

This commit is contained in:
2024-09-21 00:33:24 +02:00
parent 43bca5f51e
commit b299ea510f

View File

@@ -6,3 +6,10 @@ if vimwiki#vars#get_syntaxlocal('rxTableSep') !~ '[\d0-\d127]'
" Update after changes
call HighlightNonASCIIChars()
endif
" Fold by sections
function! MdSectionFold()
let depth = len(matchstr(getline(v:lnum), '^#*'))
return depth ? ">" . depth : "="
endfunction
setlocal foldmethod=expr foldexpr=MdSectionFold()