With features like tag-completion, auto-wrapping and unwrapping, quick navigation, etc., it has, in a matter of minutes, measurably decreased my level of frustration while editing markup in Vim.
The quickest way to install the plugin is by downloading the latest .
vbafrom the plugin site, and run the following commands:
$ vim xmledit.vba :so %
You also need to edit your
.vimrcand add the following:
filetype plugin on
This installs the plugin into your
.vim/ftplugindirectory, and enables it for
.xmlfiles. To enable it for other file types, create a link to the file with the new extension name in the same directory. (Copying the file also works.)
$ cd ~/.vim/ftplugin $ ln -s xml.vim html.vim $ ln -s xml.vim xhtml.vim
The plugin supports the various Vim modes in interesting ways.
In insert mode, when you finish a tag (with the
>character), it will be autocompleted and the cursor placed in-between the tags.
If you immediately type another
>, it will close the tag on its own line, and place the cursor on a new line right in between.
%key jumps between the start and end of a tag.
\%combination jumps between opening and closing tags. (Note that backslash is the default key-prefix for scripts and plugins to use. You can change this prefix with the
If you select text (for example with
v), and type
\x, it will prompt you to wrap the text with a custom tag.
\dunwraps surrounding tags from the cursor.
:help xml-pluginfor help and more information.
Yay for another awesome Vim plugin. You can see my entire Vim profile in my Evil Tomato GitHub Repository.