Sublime Forum

Hanging indent for Markdown lists

#1

I’m interested in getting a hanging indent (or “reverse indent”) working for Markdown list items that are long enough to be soft-wrapped to multiple lines. It’s the same request as in a question from 2012, from which I cribbed the following two examples.

Current behavior:


Desired behavior:

There’s some other discussion here and an aspirational pastebin here. Sublime-Wrap-Plus has an implementation for hard line wraps, which unfortunately isn’t what I’m looking for.

But I did find one promising angle: making Sublime Text apply a reverse indent to every soft-wrapped line, it already does for source code files. This would be an improvement for me. I learned here and on the linked Stack Exchange question that I needed to modify Markdown (Standard).tmLanguage so that Markdown files were reported as source files. And I also get there, but not quite. The behavior that results is:

Is there a solution out there to my originally problem (hanging indent for list items) or, failing that, a way to make the hanging indents for “source” files not line up exactly with lines indented one level further?

0 Likes