sponsor Vim development Vim logo Vim Book Ad

XML Completion : Completion for XML files

 script karma  Rating 15/11, Downloaded by 1934  Comments, bugs, improvements  Vim wiki

created by
David Tardon
 
script type
ftplugin
 
description
Context sensitive completion for XML.
Completes:
* element names
* attribute names (rejects already presented attributes)
* attribute values (if defined as enumeration)
* closing tag names
* keywords in XML declaration

1. Invoking

The completion function is XmlComplete() and is imapped on \C-J.

2. Completion in elements

Distribution contains definition files (recipes) for DocBook 4.[234], XSL FO 1.0, XSLT 1.0, Relax NG 1.0, XML Schemas 1.0, SVG 1.1, XHTML 1.1, XInclude 1.0 and OpenOffice 1.0 XML format.

If g:xmlSubelements == "yes" (default "no"), completion of element names is restricted on subelements of parent element. This feature is new and momentarily works only for DocBook, XSLT and XML Schemas (the recipes must be modified).

Completion algorithm:
1. If name of currently opened tag is prefixed, looks for respective xmlns mapping for its URN. If mapping exists, selects recipe associated with this URN.
2. If name isn't prefixed, looks for implicit NS. If exists, ... (see above).
3. Looks for Doctype decl. If found, tries first PUBLIC, then SYSTEM ident.
4. If all fails, fires \C-N for normal completion.
 
install details
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
xml_completion-1.18.tar.gz 1.18 2006-01-13 6.0 David Tardon Initial upload
ip used for rating: 44.220.184.63

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github