Ⅰ. 插件描述
Completion for XML filesⅡ. 基本信息
|
Ⅲ. 安装方法
使用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
- Invoking
The completion function is XmlComplete() and is imapped on C-J.
- 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:
- 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.
- If name isn't prefixed, looks for implicit NS. If exists, ... (see above).
- Looks for Doctype decl. If found, tries first PUBLIC, then SYSTEM ident.
- If all fails, fires C-N for normal completion.