Vim Tips Wiki
Advertisement

Use this page to discuss script 1397 xml: helps editing xml (and html, sgml, xslt) files

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

No compatible

You have to keep your Vim in no-compatible mode for folding to work. --02:04, September 24, 2011

I refactored the above to insert "no" because I assume no one uses Vim in compatible mode, so the original problem was due to Vim inadvertently being set for compatibility with vi. JohnBeckett 03:45, December 27, 2011 (UTC)

Installation

What do you mean by

Then create a ~/.vim/indent directory and for every link (copy) you made do

echo "let b:did_indent = 1" > ~/.vim/indent/xml.vim

?--Gqqnb 05:50, December 26, 2011 (UTC)

I moved the above to here (it had been posted on the talk page, but this page is intended for discussion on using the script).
The docs at the script page (link at top of page) are poor. My quick thought is that to install the plugin (which I have never seen), you are supposed to copy the supplied xml.vim file to ~/.vim/ftplugin/xml.vim (Unix) or $HOME/vimfiles/ftplugin/xml.vim (Windows). It looks like the same file should be copied (or linked) so it appears in the same directory as docbk.vim, xsl.vim, html.vim, xhtml.vim (if you use those file types).
If you use filetype indent on you also need (I think) to create a file in directory ~/.vim/indent (Unix) or $HOME/vimfiles/indent (Windows) for each file type that will be used (xml.vim, docbk.vim, xsl.vim, html.vim, xhtml.vim). In each case, the file contains only the output from the echo command shown in the docs, namely the single line: let b:did_indent = 1 JohnBeckett 03:45, December 27, 2011 (UTC)
For each file(xml.vim, docbk.vim, xsl.vim, html.vim, xhtml.vim) in $HOME/vimfiles/indent, change their content to let b:did_indent = 1. Am I right?--Gqqnb
These files would not exist (by default); indeed, the indent directory does not exist after a standard install, and it would have to be manually created. But yes, each file should be created and should have the same content, namely that single line (which would disable the standard ftplugin scripts distributed with Vim from affecting indentation). Note that I'm guessing as I have never tried to use script 1397. JohnBeckett 10:29, December 27, 2011 (UTC)

Language improvements

A plugin for editing xml. I used xml.vim (http://www.vim.org/scripts/script.php?script_id=301)

This makes no sense. I think you mean "I started from xmledit.vim (htt...) and made improvements"

The documentation will be created once the script is loaded e.g edit a xml file.
Read the help documentation by typing from within vim :help xml-plugin

Confusing passive voice, better:

The script creates its help documentation when it is first loaded, for example the first time you edit an xml file.
You can then read the help documentation in vim by entering :help xml-plugin

xml-plugin.txt improvements

formated documents

"formatted documents"

'%' will jump between '<' and '>'

This didn't work for me and made me think the script was broken. e.g.

Pressing '\' then '%' will jump between '<' and '>' ('\' is the default character for your <LocalLeader> character)

To activte the script place 'filetype plugin on'

Typo and better

To activate the script add 'filetype plugin on'

If the file edited is of type "html" and "xml_use_html" is defined then the following tags

Avoid passive voice, better

If you edit an HTML file (filetype=html in vim) and "xml_use_html" is defined (see xml_plugin_settings), then the following tags

Mapings and their functions

Typo, "Mappings"

[[ Goto to the next open tag

That should be ]], and use proper English "Go to" in all these lines.


Once I figured out <LocalLeader>, this is a great plug-in! -- Skierpage 04:36, February 10, 2012 (UTC)

Comments

Advertisement