Files
dotfiles/.config/vim/ftplugin/markdown.vim
Julian Prein 6531800c4a markdown.vim: Don't set formatoptions
Automatic formatting is annoying and trailing whitespace is nothing I
want ever in my files.
2025-02-05 09:35:20 +01:00

12 lines
274 B
VimL

" 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()
" Unfold everything when opening
normal zR