I have following xml file:
<?xml version="1.0" encoding="UTF-8"?>
<graph id="G" edgedefault="undirected">
<edge id="e6" source="n5" target="n4"> <data key="d1">1.1</data> <data key="d2">1.1</data> </edge>
</graph>
I have reconfigured formatprg
for xml in ~/.vim/after/ftplugin/xml.vim
:
setlocal formatprg=tidy\ -xml\ -quiet\ --indent\ auto\ --tidy-mark\ no\ --indent-spaces\ 2\ --vertical-space\ yes\
When I now press gqq
on line 3, I get
<?xml version="1.0" encoding="UTF-8"?>
<graph id="G" edgedefault="undirected">
<edge id="e6" source="n5" target="n4">
<data key="d1">1.1</data>
<data key="d2">1.1</data>
</edge>
</graph>
I want to fix the indentation automatically.
My first try was :'[,']norm =
which does not work as expected.
However, =at
does.
Ideally, I want to extend gq<text object/motion>
and gqq
so re-indentation (=
, indentexpr
) is done on the newly formatted lines.