Monday, October 12, 2020

Re: SOLVED+new Q: How to re-indent text according to type...

On Mo, 12 Okt 2020, Gary Johnson wrote:

> You're welcome.
>
> I am no expert in XML, but I thought that closing tags began with
> a slash, not a backslash; that is, with "</", not "<\". Apparently
> Vim's XML indent plugin thinks so, too.
>
> I copied your example to another buffer, set its filetype to "xml",
> replaced all backslashes with slashes, and executed "gg=G". The
> result was indented as I think you and I expected it to be, like
> this:
>
> <xml>
> <totalbytes>2952962267</totalbytes>
> <image index="1">
> <dircount>13363</dircount>
> <filecount>64267</filecount>
> <totalbytes>11707704502</totalbytes>
> <creationtime>
> <highpart>0x01cb8936</highpart>
> <lowpart>0x131f339a</lowpart>
> </creationtime>
> <lastmodificationtime>
> <highpart>0x01cb8950</highpart>
> <lowpart>0xbc4d774b</lowpart>
> </lastmodificationtime>
> <doors>
> <arch>9</arch>
> <hal>acpiapic</hal>
> <languages>
> <language>en-us</language>
> <default>en-us</default>
> </languages>
> <systemroot>doors</systemroot>
> </doors>
> <hardlinkbytes>4497873056</hardlinkbytes>
> </image>
> </xml>

Hi, xml runtime maintainer here.

This should work as mentioned. Alternatively, you might be able to use
the gq function together with :set formatexpr=xmlformat#Format()

If there are some problems, please report
https://github.com/chrisbra/vim-xml-runtime

Best,
Christian
--
Wenn etwas nützlich wird, hört es auf schön zu sein.
-- Théophile Gautier

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20201013064919.GB1656%40256bit.org.

No comments: