I use DokuWiki pretty heavily for my studies and at my job to accomplish all kind of tasks. Another piece of software I use on a daily basis is the editor VIM.

Now, when it comes to editing, syntax highlighting is a very useful thing, especially for long files. VIM provides syntax files for more than 130 languages, even more can be found on vim-scripts. There is even syntax highlighting for DokuWiki available, but I was not very happy with it.

So, here is my implementation. You can find it on my github page or on it’s vim-script page.

Screenshots

The colorschemes in use are neon and slate.

Installation

Just grab a copy of dokuwiki.vim and copy the file in your ~/.vim/syntax/ directory.

A better alternative is to use a VIM package manager such as Vundle.

Since DokuWiki uses no particular file ending you need to set the filetype manually with the command :set ft=dokuwiki. You can use the DokuWiki comment plugin to automate the task. Simply append the line below to your wiki page:

/* vim: set ft=dokuwiki */

This line will only be visible while editing the wiki page.

Development

Some important parts of the DokuWiki syntax are still missing. Just fork the project and start hacking.