I just realized that VIM 7.3 has built-in support for highlighting Markdown files. Excellent. However, it doesn't fold on the headings.
Can any offer suggestions on how to get this working?
Alternatively, I'm using Markdown only as a way to get simple structured text. If there is a better alternative format, please also suggest. But not sure I dig TVO or VimOutliner.
I'm guessing you don't watch VimCasts. The guy who makes that made a pugin for just this. Here it is: https://github.com/nelstrom/vim-markdown-folding
Based on Jeromy & Omar's suggestions, I came up with this (for my vimrc) to automatically and unambiguously fold my DokuWiki files (in which top level header is marked by ====== at start of line, down to fourth level header marked by ===):
'^=+' means match from the start of the line any number of contiguous '='s
Then this in a vim modeline makes it work nicely for a DokuWiki file:
And for Markdown, I needed to write Omar's code like this:
VOoM : Vim two-pane outliner is worth checking it out.
Not only does it provide basic folding, but it also provides outline navigation via a 2nd outline view pane (similar to document map in MS Word). And it supports a large number of markup languages including others mentioned in other answers - Markdown, viki, reStructuredText, vimwiki, org, and many others.
For more info see the screenshots and the help page.
There is
an appa plugin for that on GitHub.vim-markdown-folding
When you are editing Markdown files with Vim, you probably also want to install Tim Pope's Markdown plugin.
vim-markdown
The only way how I get folding to work in markdown, was't very elegant,
:set fdm=marker
and use html comment tagmore help
:help folding