An Emacs minor mode for dynamic virtual indentation in Markdown, similar to org-indent-mode in Org mode.
| Before | After |
|---|---|
![]() |
![]() |
- Automatically indents content based on Markdown heading levels
- Hides leading hash symbols — only the last
#is visible in headings (e.g.,###appears as#) - Visual indentation using text properties (doesn't modify actual buffer content)
(use-package markdown-indent-mode
:hook (markdown-mode . markdown-indent-mode))Toggle the mode with M-x markdown-indent-mode.
When enabled, content under headings is visually indented to align with the heading text, and leading hash symbols are hidden. Open this file in Emacs with markdown-indent-mode enabled to see it in action.
markdown-indent-mode- Toggle the mode
make test # run ERT tests
make lint # run checkdoc on both .el files
This package works similarly to org-indent-mode:
- Uses
line-prefixandwrap-prefixtext properties for visual indentation - Uses font-lock to hide leading hash symbols (making them match the background color)
- Updates indentation dynamically as you edit
- Only modifies display properties, not actual buffer content

