# Indent Block Text

Indent, outdent, dedent, or prefix every selected line of a text block with spaces, tabs, or custom text.

## Run it

- **CLI:** `gizza tool indent-block-text "alpha
beta
gamma"`
- **Web:** https://gizza.ai/tools/indent-block-text/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/indent-block-text/tool.json

## Inputs

- `text` — Text block _(field)_
- `mode` — Operation _(field)_
- `style` — Indent style _(field)_
- `count` — Count _(field)_
- `prefix` — Custom prefix _(field)_
- `lines` — Lines to change _(field)_
- `skip_blank_lines` — Skip blank lines _(field)_

## Output

- Indented text (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `text` — Text block
- `mode` — Operation
- `style` — Indent style
- `count` — Count
- `prefix` — Custom prefix
- `lines` — Lines to change
- `skip_blank_lines` — Skip blank lines

Example: `https://gizza.ai/tools/indent-block-text/?text=alpha%0Abeta%0Agamma&mode=indent&style=spaces&count=4&prefix=%3E%20&lines=all&skip_blank_lines=true`

---

## About this tool

Indent Block Text adds spaces, tabs, or any fixed prefix to selected lines of a text block. Use it to indent code snippets, create Markdown quotes, prefix lines with comment markers, make hanging indents, or normalize copied text by outdenting or dedenting it.

The default adds four spaces to every non-blank line. Switch `style` to `custom` and set `prefix` to values like `> `, `# `, or `// ` when you need quotes, headings, or code comments. Use `mode=outdent` to remove a known indentation unit, or `mode=dedent` to remove the common leading whitespace shared by the block.

### Worked example

Input:

```text
alpha
beta
```

With `mode=indent`, `style=custom`, `prefix=> `, and `count=1`, the output is:

```text
> alpha
> beta
```

### Limits and edge cases

- `count` accepts values from 0 to 200.
- Custom prefixes may be up to 100 characters.
- A trailing newline is preserved.
- Blank lines are skipped by default to avoid trailing whitespace; turn `skip_blank_lines` off when blank lines must also carry the prefix.
- Dedent ignores blank lines while measuring common indentation.

## FAQ

<details>
<summary>How do I add a Markdown quote marker to every line?</summary>

Set `style=custom`, `prefix=> `, `count=1`, and keep `mode=indent`. The prefix is inserted exactly as written, including the space after the greater-than sign.

</details>

<details>
<summary>What is the difference between outdent and dedent?</summary>

`outdent` removes up to `count` copies of the selected unit, such as four spaces or one custom prefix. `dedent` measures the common leading whitespace across selected non-blank lines and removes that shared prefix.

</details>

<details>
<summary>Can I make a hanging indent?</summary>

Yes. Set `lines=hanging`. The first line stays unchanged and every following line receives the indent or prefix.

</details>

<details>
<summary>Will blank lines get trailing spaces?</summary>

Not by default. `skip_blank_lines=true` leaves whitespace-only lines unchanged. Turn it off if you intentionally need blank lines to carry the same prefix.

</details>

## Related tools

- [Extract Action Items from Meeting Notes](https://gizza.ai/tools/action-item-extractor/): Extract action items, owners, and decisions from meeting notes or daily notes with deterministic rules. Markdown checklist or JSON, private in-browser.
- [Add Line Numbers](https://gizza.ai/tools/add-line-numbers/): Add line numbers to every line of text online, like nl or cat -n — custom start, step, separator, and alignment. Free and private, runs in your browser.
- [ANSI Log Renderer](https://gizza.ai/tools/ansi-log-renderer/): Paste ANSI-colored terminal output or CI logs and render them as HTML, or strip escape codes to plain text. Handles 16-color, 256-color, and truecolor SGR codes.
- [API response diff](https://gizza.ai/tools/api-response-diff/): Compare two JSON API responses and see only the meaningful changes: ignore request ids, timestamps and UUIDs, match arrays by key or as sets, export a JSON Patch.
- [Rust AST Diff](https://gizza.ai/tools/ast-diff/): Compare two Rust source snippets structurally. The tool parses both files, canonicalizes their ASTs, and ignores formatting, whitespace, and comments.
