dtd2vim


Ⅰ. 插件描述

Script for creation XML data file for Vim7 XML omni-completion from DTDs

Ⅱ. 基本信息

创建日期:  2006-02-12
使用用户:  1
Github星:  1
插件作者:  Mikolaj Machowski

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

Script for creation XML data file for Vim7 XML omni-completion from DTDs
Requires: perl and perlSGML (tested against 1997Sep18 version)

INSTALLATION:

   Copy into your $PATH

USAGE:

   dtd2vim <file.dtd> [<dialectname>]

This command will create file <file.vim> (remove .dtd extension and add .vim;
other extensions will remain intact).

<dialectname> (not obligatory) will be part of dictionary name and will be
used as argument for :XMLns command (file name - sans extensions) have to be
the same.

perlSGML and this script doesn't work with multiple files. User has to
prepare single DTD file to parse all data.

In created file global variable is named g:xmldata_<dialectname>. When second
argument wasn't provided 'xxxx' will be used.
After that place file in:

   ~/.vim/autoload/xml

  1. Of course it can be also global directory or other Vim data
  2. of files. Example for  DocBook 4.4:

DTD is in file docbook.dtd, call command with

   dtd2vim.pl docbook.dtd docbook44

Put file as:
  
   ~/.vim/autoload/xml/docbook44.vim

Omni-completion for DocBook 4.4 files will be started with:

   :XMLns docbook44

command.

添加新评论