3

How to promote a text line to a heading in org-mode?

ie: I start writing text and only later wants to structure it:

here's a start typing some text.
and continue on a 2nd line
and even a 3rd line.
but here I already start typing my 2nd paragraph
a new line of text

After exiting insert mode, now I would like to promote the 1st and 4th lines into heading like:

* here's a start typing some text.
    and continue on a 2nd line
    and even a 3rd line.
* but here I already start typing my 2nd paragraph
    a new line of text

thank you

3 Answers 3

8

You may be looking for the org-toggle-heading function, bound by default to C-c *.

Convert headings to normal text, or items or text to headings.

1

A sligtly easier solution (with default keybinding) is to use "Meta-Enter" (aka M-RET) at the beggining of the line you want to promote to a heading.

2
  • Are you sure? In my test here, org-mode binds S-ret to org-table-copy-down and when I use it on a plain text line it just complains "Not in table data field".
    – Stefan
    Commented Oct 2, 2017 at 21:39
  • @ Stefan: My bad, I tested on my computer before answering that it was M-Enter, but somehow I got all mixed in when posting my answer I have updated it to reflect this.
    – Joafigue
    Commented Oct 3, 2017 at 0:18
1

If using spacemacs:

  • In master repository: SPC SPC org-insert-heading RET will promote a text line to an heading.
  • In develop repository: the keyboard shortcut , i h will additionally do the same.

If using emacs (without spacemacs): M-x org-insert-heading RET

edit: Depending on the spacemacs' used repository:

edit2: I corrected my answer to reflect @Stefan remarks.

3
  • 2
    Please be a bit less terse. What does //, i h mean? How do you use it?
    – Stefan
    Commented Oct 1, 2017 at 14:42
  • @Stefan I edited my previous answer. Let me know if you need further help with that. Cheers
    – ygol
    Commented Oct 2, 2017 at 15:26
  • 1
    You might want to make it more clear that your answer presumes the use of Spacemacs. In a default Emacs config, you'd do M-x org-insert-heading RET instead.
    – Stefan
    Commented Oct 2, 2017 at 21:36

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.