I posted this question on stackoverflow earlier, but perhaps this is a better place for it?
I am looking for a way to left-align text in Org-mode so that the paragraphs line up like in FoldingText. Here is an example:
* Headline number 1 ** Headline number 2 [0/2] Here is some text before our first unordered list: - List item 1 - List item 2 And here is a checklist: - [ ] Do this first - [ ] Do this next ** Headline number 4
I've tried using
align-regexp but I am having trouble figuring the correct regex string... any ideas?
Here's an update
I got this working with the following code:
(defun align-ft (p1 p2) "Align outlines like FoldingText" (interactive "r") (align-regexp p1 p2 "\\(^\\*+\\s-\\|^-\\s-\\|^\\)." -1 0 nil) )
The only problem is that it aligns text by adding spaces, and I don't want spaces hard-coded into the document. I just want it to display, as if the spaces were there (like in
org-indent-mode). Also, this code requires the region to be highlighted and ultimately, I just want it to auto-align the entire document, as I type.