Contents

Install the moin.vim script by copying the file to
~/.vim/syntax/moin.vim on Unix-based systems, or to $HOME/vimfiles/syntax/moin.vim on Windows systems.

You may need to create the .vim (or vimfiles) directory, and you may need to create the syntax subdirectory. In Vim, your home directory is specified with ~ on Unix systems, and $HOME on Windows systems. You can see what directories to use by entering commands like the following in Vim:

This will allow you to fold wiki sections that start with a header like ==section== or ===subsection===, etc. It is done through expression folding, so you have to define the folding expression and set the proper fold method (expr).

Create file ~/.vim/ftplugin/moin.vim (Unix) or $HOME/vimfiles/ftplugin/moin.vim (Windows). The contents of the file should be:

The optional expandtab setting expands any tab characters that you insert to an equivalent number of spaces.

For security, it is highly desirable to switch modelines off to avoid applying settings or executing code that someone may have inserted in a modeline on the wiki.

The optional foldlevel=20 setting means that all folds will initially be open so you can see everything (you can close folds if wanted). If you prefer all folds to be closed initially, omit this line. :help folding

It is necessary to tell Vim to associate MoinMoin files with the moin filetype so you don't need to manually enter :setlocal filetype=moin when editing a wiki file. The following rule in filetype.vim will cause Vim to identify all files with extension .moin as MoinMoin files.

Someone should add MoinMoin syntax to this, but unless you're sure your content will always and only be in MoinMoin, I'd recommend using txt2tags syntax as your "master source" anyway - Vim syntax highlighting and tag completion available for that as well.

Am I missing something? Voom seems to have almost nothing to do with folding, it generates an outline in a separate buffer by grabbing the content of the current buffer and removing everything but the lines with fold markers. And regardless of what your "master source" is, whether your MoinMoin is hand-written or auto-generated, it's often useful to apply folding to it. --Fritzophrenic 16:30, November 28, 2011 (UTC)