Vscode: [folding] Add code folding for markdown based on heading level

Created on 23 Feb 2016  路  14Comments  路  Source: microsoft/vscode

# Some heading

Collapsing `#` should collapse all lower level headings; `##`, `###`, etc.

## Another heading

Collapsing `##` should collapse all lower level headings; `###`, `####`, etc.

### Another heading

And so on...
editor-folding feature-request markdown verification-needed verified

Most helpful comment

Please refer to the org-mode tab feature to implement, it's powerful.

All 14 comments

:+1:

+1

Why is this essential feature still not a thing?

@darkf because it relies on #3422 which is non-trivial and it needs to be prioritized against other work.

+1

+1

+1
or adding a heading list view(TOC view) on the right side, it's really convenient for editing a large markdown file.

Please refer to the org-mode tab feature to implement, it's powerful.

+1

duplicate of #3422

Reopening to track the markdown specific work of #3422

I noticed that this is already implemented in the latest insider build, thanks a lot.
One more request, would you please preserve the last blank line of a folded region?
I mean

- # Heading 1

  Some text

- # Heading 1

  Another text

becomes

+ # Heading 1

+ # Heading 1

instead of

+ # Heading 1
+ # Heading 1

One reason is that currently

- # Heading 1           - # Heading 1

  ...                     ...

- ## Subheading 1  -->  + ## Subheading 1
                        - # Heading 2
  ...

- # Heading 2

Can anyone update the status on this?

@hikinthru it's coming to the next stable release.

Was this page helpful?
0 / 5 - 0 ratings