Indentation is structure in YAML
In YAML, indentation decides which key a value belongs to. That is why FormatYAML never re-indents text with search and replace: it re-lays out the parsed document, then proves the new layout produces the same tree.
Tabs are not allowed for indentation in YAML. If your file has them, the parser reports the exact line and the formatter refuses to guess; the Invisible tab shows where they are.
Indented or flush sequences
Both styles are valid. “Indented” puts list dashes one level under their key; “flush” (used by kubectl and many Kubernetes examples) keeps dashes at the key’s column. Pick one with “Indent sequences”.
Block scalars keep their internal relative indentation. A block with leading spaces gets an indentation indicator that matches the new step, and the decoded text is checked byte for byte.
Questions
- What indent does my file use?
- The Checks tab shows the most common indentation step detected in your source, next to the step you chose.
- Can I convert 4 spaces to 2?
- Yes: set Indent to 2. Nested sequences, block scalars and comments are re-indented consistently.