My problem is auto-formatting/indenting XML in Geany, when XML is not properly indented or has no indentation at all.
As I see no Geany plugins for this purpose, I am thinking about using a custom command through Edit > Format > Send Selection To. I have tried to use xmllint --format for this without success, as it seems like Geany passes it a string, but xmllint expects a file.
Found a solution. To achieve Xml indentation auto-correction in Geany (Mint/Ubuntu):
Install xmlindent CLI tool:
$ sudo apt-get install xmlindent
In Geany, at Edit > Format > Send selection To > Set Custom Commands add a command:
xmlindent -i 4 -f
This indents lines by 4 spaces and forces newlines on elements without children.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With