Structure Editing (The Org Manual)

Next: Sparse Trees, Previous: Motion, Up: Document Structure [Contents][Index]

### 2.4 Structure Editing

`M-RET` (`org-meta-return`)

  Insert a new heading, item or row.

  If the command is used at the beginning of a line, and if there is a heading or a plain list item (see Plain Lists) at point, the new heading/item is created before the current line. When used at the beginning of a regular line of text, turn that line into a heading.

  When this command is used in the middle of a line, the line is split and the rest of the line becomes the new item or headline. If you do not want the line to be split, customize `org-M-RET-may-split-line`.

  Calling the command with a `C-u` prefix unconditionally inserts a new heading at the end of the current subtree, thus preserving its contents. With a double `C-u C-u` prefix, the new heading is created at the end of the parent subtree instead.

`C-RET` (`org-insert-heading-respect-content`)

  Insert a new heading at the end of the current subtree.

`M-S-RET` (`org-insert-todo-heading`)

  Insert new TODO entry with same level as current heading. See also the variable `org-treat-insert-todo-heading-as-state-change`.

`C-S-RET` (`org-insert-todo-heading-respect-content`)

  Insert new TODO entry with same level as current heading. Like `C-RET`, the new headline is inserted after the current subtree.

`TAB` (`org-cycle`)

  In a new entry with no text yet, the first `TAB` demotes the entry to become a child of the previous one. The next `TAB` makes it a parent, and so on, all the way to top level. Yet another `TAB`, and you are back to the initial level.

`M-LEFT` (`org-do-promote`)

  Promote current heading by one level.

`M-RIGHT` (`org-do-demote`)

  Demote current heading by one level.

`M-S-LEFT` (`org-promote-subtree`)

  Promote the current subtree by one level.

`M-S-RIGHT` (`org-demote-subtree`)

  Demote the current subtree by one level.

`M-UP` (`org-move-subtree-up`)

  Move subtree up, i.e., swap with previous subtree of same level.

`M-DOWN` (`org-move-subtree-down`)

  Move subtree down, i.e., swap with next subtree of same level.

`C-c @` (`org-mark-subtree`)

  Mark the subtree at point. Hitting repeatedly marks subsequent subtrees of the same level as the marked subtree.

`C-c C-x C-w` (`org-cut-subtree`)

  Kill subtree, i.e., remove it from buffer but save in kill ring. With a numeric prefix argument N, kill N sequential subtrees.

`C-c C-x M-w` (`org-copy-subtree`)

  Copy subtree to kill ring. With a numeric prefix argument N, copy the N sequential subtrees.

`C-c C-x C-y` (`org-paste-subtree`)

  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 numeric prefix argument, or by yanking after a headline marker like ‘`****`’.

`C-y` (`org-yank`)

  Depending on the variables `org-yank-adjusted-subtrees` and `org-yank-folded-subtrees`, Org’s internal `yank` command pastes subtrees folded and in a clever way, using the same command as `C-c C-x C-y`. With the default settings, no level adjustment takes place, but the yanked tree is folded unless doing so would swallow text previously visible. Any prefix argument to this command forces a normal `yank` to be executed, with the prefix passed along. A good way to force a normal yank is `C-u C-y`. If you use `yank-pop` after a yank, it yanks previous kill items plainly, without adjustment and folding.

`C-c C-x c` (`org-clone-subtree-with-time-shift`)

  Clone a subtree by making a number of sibling copies of it. You are prompted for the number of copies to make, and you can also specify if any timestamps in the entry should be shifted. This can be useful, for example, to create a number of tasks related to a series of lectures to prepare. For more details, see the docstring of the command `org-clone-subtree-with-time-shift`.

`C-c C-w` (`org-refile`)

  Refile entry or region to a different location. See Refile and Copy.

`C-c ^` (`org-sort`)

  Sort same-level entries. When there is an active region, all entries in the region are sorted. Otherwise the children of the current headline are sorted. The command prompts for the sorting method, which can be alphabetically, numerically, by time—first timestamp with active preferred, creation time, scheduled time, deadline time—by priority, by TODO keyword—in the sequence the keywords have been defined in the setup—or by the value of a property. Reverse sorting is possible as well. You can also supply your own function to extract the sorting key. With a `C-u` prefix, sorting is case-sensitive.

`C-x n s` (`org-narrow-to-subtree`)

  Narrow buffer to current subtree.

`C-x n b` (`org-narrow-to-block`)

  Narrow buffer to current block.

`C-x n w` (`widen`)

  Widen buffer to remove narrowing.

`C-c *` (`org-toggle-heading`)

  Turn a normal line or plain list item into a headline—so that it becomes a subheading at its location. Also turn a headline into a normal line by removing the stars. If there is an active region, turn all lines in the region into headlines. If the first line in the region was an item, turn only the item lines into headlines. Finally, if the first line is a headline, remove the stars from all headlines in the region.

When there is an active region—i.e., when Transient Mark mode is active—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 point is inside a table (see Tables), the Meta-Cursor keys have different functionality.

Next: Sparse Trees, Previous: Motion, Up: Document Structure [Contents][Index]