Skip to content
Fold markdown documents by section.
VimL Ruby
Find file
Pull request Compare This branch is 16 commits behind master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
after/ftplugin/markdown
doc
test
.gitignore
README.md

README.md

This plugin enables folding by section headings in markdown documents.

Thanks to Kana Natsuno for helping me to test drive this code using vspec.

Running the tests

test/folding.vim contains tests written in the vspec format. Here are the barebones instructions for executing the tests, assuming that vspec and markdown-folding plugins are installed as follows:

.vim/
  bundle/
    vspec/
      bin/
        vspec
    markdown-folding/
      test/
        folding.vim

You can run the tests as follows:

cd .vim/bundle/markdown-folding
../vspec/bin/vspec ../vspec . test/folding.vim

Execute the tests from inside Vim with this quick-and-dirty mapping (assumes working directory to be .vim/bundle/markdown-folding):

nnoremap <leader>r :wa <bar> ! ../vspec/bin/vspec ../vspec/ . test/folding.vim<CR>
Something went wrong with that request. Please try again.