Skip to content

Instantly share code, notes, and snippets.

View jlacar's full-sized avatar

Junilu Lacar jlacar

  • Columbus, OH
View GitHub Profile
@jlacar
jlacar / format-xml-vi.md
Last active May 25, 2023 18:52
Format XML in vi using xmllint

Formatting XML in vi

Using xmllint

You can format XML in vi using xmllint

:%!xmllint "%" --format

Default indentation is 2 spaces. You can change that by assigning a value to the XMLLINT_INDENT environment variable. To do that without