This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" vim: fdc=5 | |
" http://groups.google.com/group/vim_use/browse_thread/thread/fedd5c8e45162d3f | |
" THE GOAL: Write Vim folding expression that | |
" - starts fold on lines matching 'start' | |
" - ends fold on lines matching 'stop' | |
" - DOES NOT USE "a", "s", "=" | |
" (this should be same as :set fdm=marker fmr=start,stop) | |
" stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" folding for Markdown headers, both styles (atx- and setext-) | |
" http://daringfireball.net/projects/markdown/syntax#header | |
" | |
" this code can be placed in file | |
" $HOME/.vim/after/ftplugin/markdown.vim | |
" In Markdown, setext-style overrides atx-style, so we first check for an | |
" underline. Empty lines should be ignored when underlined. | |
func! Foldexpr_markdown(lnum) | |
let l1 = getline(a:lnum) |