Add comment-like support to vim markdown files

2018-05-09 20:38:00

My requirement is that I would like to augment the standard markdown behaviour as found in Vim 8.0.

I typically edit files whose contents are like the following. Each line of text can vary in length from a few characters to several hundred.

test.md

# Section 1

## Section 1.1

line of text

line of text

line of text

## Section 1.2

line of text

line of text

I find Vim very helpfully highlights each section header and supports folding sections logically.

What I haven't found a way to do is to extend this functionality to add syntax and folding support for files like:

# Section 1

[[

I am not strictly document content, more metadata in nature

So will be folded most of the time

]]

## Section 1.1

[[

This is a bunch of lines

that I rarely wish to see.

Hiding most of the time would be very useful

]]

line of text

line of text

line of text

## Section 1.2

line of text

line of text

The addition of the lines between [[ and ]] poses a problem. I want to be able to f