Syntax highlighting for editing MoinMoin contents with vim

It's not complete, but it's a start If anybody has a better idea, which pre-defined targets to link the highlighting to, feel free, to edit this page.

Usage

To use this, add the following block to ~/.vim/filetype.vim

augroup filetypedetect
au BufNewFile,BufRead *.moin setf moin
au BufNewFile,BufRead *.wiki setf moin
augroup END

Download moin.vim and copy to ~/.vim/syntax/

To enable syntax highlighting of a particular wiki page, add the following as a comment on the page:

## vim:filetype=moin

Or simply save the text file as filename.moin , vim will automatically recognize this suffix name.

This works very nicely with the ViewSourceWith or mozex or Editus Externus or It's All Text! extension for Mozilla/Firefox.



" Links
" syn match       moinWikiWord            /\(\w\+:\)\?\u[a-z0-9]\+\u[a-z0-9]\+/
syn match       moinWikiWord            /\(\w\+:\)\?\u[a-z0-9]\+\(\u[a-z0-9]\+\)\+/


syn clear
hi clear

should be removed. hi clear just destroy all the highlighting that is set outside, which is 100% wrong. And hi clear is needed only for Vim before version 6.0 and this is already done earlier.

hi clear

Should be removed. It removes the highlighting of other colorschemes. To test: Load a colourscheme that differs from the default. Then load a moin file and you'll see that the colorscheme is removed. Tested with Vim 7


other VimHighlighting sources

The file, moinmoin.vim, is available here: http://broofa.com/Tools/vim/syntax/moinmoin.vim

Feel free to try it out, or pull it apart and integrate anything useful into this script. (Sorry, but I just don't have the expertise to do a good job of that). :)


The editmoin project allows you to edit Moin pages with your preferred editor, and it comes with Vim support and a VimHighlighting syntax. Since version 1.10 editmoin supports both 1.5 and 1.6 syntaxes -- FrBrGeorge 2008-10-26 21:37:01

MoinMoin: VimHighlighting (last edited 2014-08-27 02:07:03 by 180)