0

I want electric-indent or more generally, hitting ENT, to indent the new line to the beginning of text. I'd like this to work with auto-fill as well.

Before:

1. This is a long list item that I'll wrap at 50
chars. This is what happens.
2. Next item.

After:

1. This is a long list item that I'll wrap at 50
   chars. This is what I want.
2. Next item.

I'd even accept a solution that let's me fix this after the fact, meaning I'm okay with highlighting the region and entering a command that indents it the way I want. Something built-in preferred.

2
  • 1
    What is the buffer's major mode? Commented Mar 24, 2022 at 20:08
  • Major mode: text-mode.
    – mcp
    Commented Apr 22, 2022 at 16:36

2 Answers 2

1

What you want is either outline-mode or org-mode, both of which will give you this behavior.

2
  • Interesting, I never tried outline-mode. Will give it a shot!
    – mcp
    Commented Apr 28, 2022 at 17:17
  • Does not work as expected. Same behavior as text-mode.
    – mcp
    Commented Jun 3, 2022 at 14:37
0

In markdown-mode, auto-fill will indent as desired.

It also has convenient functions for adding a new list item (markdown-insert-list-item) and re-numbering a list (markdown-cleanup-list-numbers), while staying very close to text-mode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.