I wanted to indent my XML files with 4 spaces.
I tried to google it, and found this and this one.
But they seem pretty old and/or didn't help me.

This post is great about how to pretty print XML files, but gives no hint how to set indent to a specific value. How can I do that?

1 Answer 1


I finally found it in this issue.

(setq nxml-child-indent 4 nxml-attribute-indent 4)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.