RefDB Features: Vim support

RefDB plays well with Vim. You'll get support for both editing of RIS bibliographic data and for your DocBook XML documents. Vim support is not included in the RefDB sources, but available separately.

On this page
Vim and Docbook XML editing
Vim and RIS editing

Vim and DocBook XML editing

Author: David Nebauer <davidnebauer@swtch.com.au>

Package: vim-docbk-xml-refdb (1.2) [source, deb].

Requires: imagemagick [web, deb]; fop [web, deb]; xmllint [web, deb]; xsltproc [web, deb]; libgetopt-declare-perl web, deb]; refdb-cache (1.0) [source, deb]; libperl-refdb-cache (1.0) [source, deb].

If Vim is the editor of your choice, this package installs the syntax, filetype and plugin files that enable you to edit DocBook XML files.

The plugin has a rather extensive list of dependencies as it interacts with a great many components in order to perform all its functions. For example, in order to create and view PDF and (X)HTML output it must use an XML validator (xmllint), an XSLT processor (xsltproc), a FO processor (fop), an HTML viewer and a PDF viewer. There are other dependencies which are not listed as they are commonly available on most *nix systems. For further information on dependencies unpack the source archive, read the README file and type ./configure --help. Debian users need only select the primary package and the rest will happen automagically

While this suite consists of a number of components, all its functionality is exposed as keystroke mappings. All mappings (except special characters) are available via the DocBook menu (menus can be accessed from console vim — see vim help topic 'console-menus').

The source distribution can be built with support for multiple XSLT processors (xsltproc, Saxon, Xalan), FO processors (FOP, Xep), xml validators (xmllint, RXP) and, of course, RefDB.

The Debian package has a minimal configuration with support for only one XSLT processor (xsltproc), one FO processor (Fop), one xml validator (xmllint) and RefDB.

Here is an overview of the functionality supplied by the plugin:

Vim DocBook XML Menus

Fig. 4: GVim editing a DocBook XML file. All the DocBook XML supplied menus are being displayed (they have been "torn off"). The left-most menu is the parent menu. The citations (RefDB) menu is seen on the far right. Note that users of console vim also have access to these menus (see vim help topic 'console-menus'. Click on the image to see a larger version.

Vim and RIS editing

Author: David Nebauer <davidnebauer@swtch.com.au>

Package: vim-ris (1.2) [source, deb].

If Vim is the editor of your choice, this package installs the syntax, filetype and plugin files that enable you to edit RIS files.

What the syntax file does not currently do is handle line continuations ('/$') -- it assumes all fields are a single line

The plugin file supplies five convenience commands mapped to keyboard shortcuts:

Vim editing RIS

Fig. 5: Vim editing RIS. Click on the image to see a larger version. The image shows how Vim spots a few common syntax errors: (1) the second author uses a space after the comma, (2) the publication date lacks the mandatory slashes, and (3) the end tag lacks the trailing space.