> For the complete documentation index, see [llms.txt](https://roam-tui.avelino.run/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://roam-tui.avelino.run/tui/multi-select.md).

# Multi-Block Selection

Select multiple blocks at once and perform batch operations: delete, indent, or dedent all selected blocks in one step.

## Selecting blocks

Extend the selection with `Shift+Up` and `Shift+Down` from the current cursor position. The selection is always a contiguous range.

| Action      | Vim          | Emacs        | VSCode       |
| ----------- | ------------ | ------------ | ------------ |
| Select up   | `Shift+Up`   | `Shift+Up`   | `Shift+Up`   |
| Select down | `Shift+Down` | `Shift+Down` | `Shift+Down` |

All selected blocks are visually highlighted.

### Resetting selection

Any regular movement key (`j`/`k`, arrows, page up/down) collapses the selection back to a single block cursor.

## Batch operations

With multiple blocks selected:

| Operation | Key         | Effect                                             |
| --------- | ----------- | -------------------------------------------------- |
| Delete    | `dd`        | Deletes all selected blocks                        |
| Indent    | `Tab`       | Indents all selected blocks under previous sibling |
| Dedent    | `Shift+Tab` | Dedents all selected blocks to parent level        |

### Delete

All blocks in the selection range are removed. The API call uses batch-actions to delete them in a single request.

### Indent / Dedent

Each block in the selection is indented (or dedented) individually, preserving relative order. All moves are sent as a batch API call.

## Undo

Batch operations create a single undo entry. Pressing undo (`u` in Vim, `Ctrl+/` in Emacs, `Ctrl+Z` in VSCode) reverts the entire batch operation in one step — all deleted blocks are restored, or all indent/dedent moves are reverted.

## Limitations

* Selection is always a **contiguous range** (no non-contiguous multi-select like Cmd+Click in Roam web)
* Selection does not span across **linked refs** sections
* Entering **insert mode** resets the selection
* Selection works only in **Normal mode**


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://roam-tui.avelino.run/tui/multi-select.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
