XML Completion


Ⅰ. 插件描述

Completion for XML files

Ⅱ. 基本信息

创建日期:  2006-01-13
使用用户:  3
Github星:  3
插件作者:  David Tardon

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/xml-completion'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/xml-completion'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/xml-completion'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/XML-Completion

Ⅳ. 文档说明

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.

    1. 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.

    添加新评论