Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7703663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:30:37+00:00 2026-05-31T23:30:37+00:00

How could I convert a VimOutliner file to Markdown? In other words, I how

  • 0

How could I convert a VimOutliner file to Markdown?
In other words, I how to turn tab-indeted outlines like this…

Heading 1
    Heading 2
            Heading 3
            : Body text is separated by colons.
            : Another line of body text.
    Heading 4

…into hash-style headings separated by an empty line like this:

# Heading 1

## Heading 2

### Heading 3

Body text.

## Heading 4

I have tried defining a macro but I’m fairly new to Vim (and not a coder) so I’ve been unsuccessful so far. Thanks for any help!

(PS — As for Markdown, I do know about the awesome VOoM plugin but I still prefer doing initial outlines for documents with no hash-characters in sight. Plus, I also like the way VimOutliner highlights different levels of headings.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:30:38+00:00Added an answer on May 31, 2026 at 11:30 pm

    Place this functions in your vimrc and just use :call VO2MD() or :call MD2VO() as needed.

    function! VO2MD()
      let lines = []
      let was_body = 0
      for line in getline(1,'$')
        if line =~ '^\t*[^:\t]'
          let indent_level = len(matchstr(line, '^\t*'))
          if was_body " <= remove this line to have body lines separated
            call add(lines, '')
          endif " <= remove this line to have body lines separated
          call add(lines, substitute(line, '^\(\t*\)\([^:\t].*\)', '\=repeat("#", indent_level + 1)." ".submatch(2)', ''))
          call add(lines, '')
          let was_body = 0
        else
          call add(lines, substitute(line, '^\t*: ', '', ''))
          let was_body = 1
        endif
      endfor
      silent %d _
      call setline(1, lines)
    endfunction
    
    function! MD2VO()
      let lines = []
      for line in getline(1,'$')
        if line =~ '^\s*$'
          continue
        endif
        if line =~ '^#\+'
          let indent_level = len(matchstr(line, '^#\+')) - 1
          call add(lines, substitute(line, '^#\(#*\) ', repeat("\<Tab>", indent_level), ''))
        else
          call add(lines, substitute(line, '^', repeat("\<Tab>", indent_level) . ': ', ''))
        endif
      endfor
      silent %d _
      call setline(1, lines)
    endfunction
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How could I merge / convert multiple PDF files into one large PDF file?
How i could convert datetime 5/8/2011 12:00:00 AM (m/d/yyyy) to dd-MMM-yyyy like 08-May-2011 in
Can anyone explain to me how I could convert this sample function to use
I'm searching for a free component or library that could convert HTML to PostScript
Anyone know of a nice efficient function that could convert, for example: HelloWorld -->
Convert angle in degrees to a point How could I convert an angle (in
Is there something available that could help me convert a XSD into SQL relational
How can I convert xml to java so that it could read the xml
Can anyone recommend a good application that could be used to convert VB.NET projects
In the following snippet my intention is to convert a System.Object (which could be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.