2

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

4

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.

  • 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 Oct 2 '17 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 Oct 3 '17 at 0:18
0

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.

  • 2
    Please be a bit less terse. What does //, i h mean? How do you use it? – Stefan Oct 1 '17 at 14:42
  • @Stefan I edited my previous answer. Let me know if you need further help with that. Cheers – ygol Oct 2 '17 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 Oct 2 '17 at 21:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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