sponsor Vim development Vim logo Vim Book Ad

xml_cbks : Extends xmledit package to provide schema-specific attribute callbacks easily

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

created by
Brett Williams
 
script type
utility
 
description
This script extends the functionality of the excellent xmledit plugin.
xmledit gives you a single global callback for inserting attributes,
XmlAttribCallback.  The suggestion is that this method will dispatch based
on which tag is received.  The script provides a hook that will set the
variable b:xml_doctype when loaded (via the function XmlFindDocType).  Then
it provides a generic XmlAttribCallback which does the following:
  1.  Looks for a file called $VIMXMLEDITCALLBACKS/{b:xml_doctype}.vim
  2.  If that file exists and hasn't already been loaded, it is sourced
This file is expected to provide a function called
XmlAttribCallback_{b:xml_doctype}.  This function is called if it exists,
passing the xml_tag as the argument.

The intent is so that you can have a different callback for each doctype (schema) which will automatically be available when you edit an XML file of a
specified type.  The plugin also provides a way to provide any doctype
specific functionality automatically (you can put anything in the sourced
script).   It is almost like a secondary ftplugin for xml.

Note:  This is my first vim script (I've been using vim for less than 3 weeks) so any suggestions for improvement are very welcome.
 
install details
Put xml_cbks.vim in your plugin directory (personal or shared).

Put xml_cbks.txt in your doc directory and then see :help add-local-help to install the help.
 

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_cbks.zip 0.11 2003-06-02 6.0 Brett Williams Fixed some unlets which were out of place.
xml_cbks.zip 0.1 2003-06-02 6.0 Brett Williams Initial upload
ip used for rating: 18.223.32.230

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