2.5 Structure editing
- M-<RET>
- Insert new heading with same level as current. If the cursor is in a
plain list item, a new item is created (see Plain lists). To force
creation of a new headline, use a prefix arg, or first press <RET>
to get to the beginning of the next line. When this command is used in
the middle of a line, the line is split and the rest of the line becomes
the new headline. If the command is used at the beginning of a
headline, the new headline is created before the current line. If at
the beginning of any other line, the content of that line is made the
new heading. If the command is used at the end of a folded subtree
(i.e. behind the ellipses at the end of a headline), then a headline
like the current one will be inserted after the end of the subtree.
- M-S-<RET>
- Insert new TODO entry with same level as current heading.
- M-<left>
- Promote current heading by one level.
- M-<right>
- Demote current heading by one level.
- M-S-<left>
- Promote the current subtree by one level.
- M-S-<right>
- Demote the current subtree by one level.
- M-S-<up>
- Move subtree up (swap with previous subtree of same
level).
- M-S-<down>
- Move subtree down (swap with next subtree of same level).
- C-c C-x C-w
- C-c C-x C-k
- Kill subtree, i.e. remove it from buffer but save in kill ring.
- C-c C-x M-w
- Copy subtree to kill ring.
- C-c C-x C-y
- Yank subtree from kill ring. This does modify the level of the subtree to
make sure the tree fits in nicely at the yank position. The yank
level can also be specified with a prefix arg, or by yanking after a
headline marker like `****'.
- C-c ^
- Sort same-level entries. When there is an active region, all entries in
the region will be sorted. Otherwise the children of the current
headline are sorted. The command prompts for the sorting method, which
can be alphabetically, numerically, by time (using the first time stamp
in each entry), and each of these in reverse order. With a C-u
prefix, sorting will be case-sensitive. With two C-u C-u
prefixes, duplicate entries will also be removed.
When there is an active region (transient-mark-mode), promotion and
demotion work on all headlines in the region. To select a region of
headlines, it is best to place both point and mark at the beginning of a
line, mark at the beginning of the first headline, and point at the line
just after the last headline to change. Note that when the cursor is
inside a table (see Tables), the Meta-Cursor keys have different
functionality.