poniedziałek, 14 grudnia 2015

How to format xml with xmllint using tab instead of double space

Using xmllint is very handy way of formatting xml, but suffers from limitted formatter options. Luckly the most crucial is available but not very straitforward to use. xmllint is using XMLLINT_INDENT system variable for setting characters sequence used as indentation. To set it as \t character you need a special trick ($'\t')
$ export XMLLINT_INDENT=$'\t'
Now every xmllint --format will use tab for indentation. Setting formatting command for vim.
map @@x !%xmllint --format --recover -^M

Brak komentarzy:

Prześlij komentarz