---
title: Nesting list items
slug: lists
summary: Tab moves a list item one level in, Shift+Tab one level out. What Sashmark writes for a nested list, and where Tab does not act on lists.
---

# Nesting list items

Put the cursor in a list item and press **Tab** to move it one level in, under the item above it. Press **Shift+Tab** to move it one level out. This works for bullets (`- `) and for to-do items (`- [ ]` and `- [x]`). Nothing is written until you press **Cmd/Ctrl+S** (see Editing and saving a file).

## The keys

| Key | Where | What happens |
|---|---|---|
| Tab | An item with an item above it | It moves one level in, under the item above. That item can be a numbered item; the bullet stays a bullet. |
| Tab | An item that has items under it | It moves in, and every item under it moves with it. |
| Tab | Several items selected | Each selected item moves in one level. A parent selected with its child moves once; the child stays one level under it. |
| Shift+Tab | A nested item | It moves one level out and now comes after its old parent. The items under it go with it. |
| Shift+Tab | A nested item with items after it at the same level | Only that item moves out. The later items keep their lines as they are, so they now sit under the item you moved. |
| Shift+Tab | Several items selected | Each selected item moves out one level. An item above the selection does not move. |

A to-do item keeps its tick when it moves. No list key ticks or unticks a box.

## Keys that do nothing

These presses are used up: no text, cursor, or unsaved-edits change, and the focus stays in the page.

- **Tab on the very first item of a list**, when no list item of any kind is above it. Sashmark does nothing here.
- **Shift+Tab on an item that is already at the top level.**
- **Tab or Shift+Tab on a read-only list item.** See [When editing is off](document-lock.md).
- **Tab or Shift+Tab while a save is running.** The press is not kept for later.

## Numbered items

The keys on this page are for bullets and to-do items. With the cursor in a numbered item (`1. `), Tab and Shift+Tab work as they did before this feature: Tab on a numbered item with a numbered item above it moves it in, Tab on a first numbered item types four spaces, and Shift+Tab on a numbered item at the top level turns it into a plain paragraph. A bullet under a numbered item is a bullet, so the table above applies to it; Shift+Tab there moves it out to become a numbered item.

## Empty items

Sashmark treats an empty list item differently from Obsidian. This is what Sashmark does:

- An empty bullet that was loaded from the file (a line holding only `- `) is read-only, and Tab there does nothing. A save that would put a tab in front of that line is refused, and nothing is written.
- A new empty item that you make, nest, and save before typing any text is written as a tab, then `- `, then `<br />`. Once you type text and save again, the line holds your text instead.
- A file can already hold a line that is a tab, then `- `, then nothing. Markdown does not read that line as a nested item. It reads it as the underline of a heading, so Sashmark shows the item above as a heading with no child, and that item is read-only. Sashmark never rewrites either line when you save an edit to another line.

## What is written to the file

- **A first child gets one tab.** The first child under an item starts with its parent's own indent, then one literal tab. An item that moves in beside an earlier child takes that child's indent instead, so in a list indented with two spaces it gets two spaces, not a tab (see the two lines on spaces below).
- **New bullets are written as `- `.** New to-do items are `- [ ] ` or `- [x] `.
- **No blank line is added** between a parent and its child when the parent is a single line of text. Blank lines you already had around other items stay.
- **The file's line endings are kept.** In a file with Windows-style CRLF line endings, every line Sashmark writes ends in CRLF too. A byte order mark at the start stays, once.
- **Lines you did not touch stay byte for byte.** Moving one item writes that item's line, the lines of the items under it, and the blank line beside it when one has to go. Every other line stays as it was.
- **A new child gets a tab even in a file that indents with spaces.** Its line starts with its parent's own leading spaces, then one tab.
- **An item with an earlier item at its new level takes that item's indent.** In a list indented with two spaces, a second child is written with the same leading spaces as the first child, so both stay at one level.
- **An item with a second paragraph or a line break inside it** moves whole. Its later lines get the new indent, and the blank line inside it stays.

Example. Before:

```
- Jane Doe
- Doe child
```

After Tab on the second line and a save, where the gap before the second `-` is one tab:

```
- Jane Doe
	- Doe child
```

## Undo

**Cmd/Ctrl+Z** takes back one Tab or Shift+Tab in one step. If you undo before saving, no line of the file changes. If you undo after saving and save again, only the item you moved is written again.

## Where Tab does not act on lists

- **In a plain paragraph**, Tab types spaces, as before.
- **In a code block**, Tab belongs to the code block, as before. A list item that holds the code block does not move.
- **In the frontmatter's Edit raw text**, Tab moves the focus on, as before.
- **In text fields and other controls** outside the page, Tab and Shift+Tab move the focus, as before.
- **With the focus on a check box** in a to-do list, Tab moves the focus on and the item does not move.

## How this was checked

Some of the keys above were compared by hand, once, by the app's owner, with the bytes Obsidian 1.14.4 wrote on macOS, and Sashmark wrote the same bytes for them: Tab on a second bullet or a second to-do item, Tab on a bullet under a numbered item, Tab with two items or a parent and its child selected, Shift+Tab on a first or last child or on a child to-do item, Shift+Tab with a selection across two levels, and a nested list typed from nothing. That is a record of one manual check, not a promise about every Obsidian version or system. Sashmark's automated tests check the bytes Sashmark writes; they do not run Obsidian.

Three cases are different from Obsidian on purpose, and this page says what Sashmark does: Tab on the very first item does nothing, Tab on an item with items under it moves them all, and empty items work as described above.
