Use vim to convert markdown headings to org headings

Viewed 72

Use vim to convert a file of markdown headings to org heading.

For example, change this:

# heading one
body
##heading two
### heading three
body

to this:

* heading one
body
**heading two
****** heading six

Only a continues sequence of '#' starting at column 0 should be substituted with an equal number of '*'.

This substitutes only the first '#' with '*':

%s/^[#]/*/c

But there can be up to six '#' to substitute.

1 Answers
Related