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.
Have you considered posting this work to http://vim.org so other vim users will be more likely to know about it? You can do so here: http://www.vim.org/scripts/add_script.php -- MicahElliott
Good idea. It's at http://www.vim.org/scripts/script.php?script_id=1459 -- DavidOcallaghan
Which version is the master? Do you want updates posted here or emailed to the original author? There's the version on vim.org, the inline code inside this page, and the attachment. I took the liberty to remove the inline code, and updated the attachment moin.vim with rudimentary support of the new MoinMoin 1.6 syntax. -- IngoKarkat
This works great with EditMoin. I used the following tweak to get better CamelCase highlighting for wiki names with more than two words. -- DavidHuttlestonJr 2006-05-05 19:16:01
" 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]\+\)\+/
- I belive that lines
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.
- I've tested these changes in Vim 7 and they seem fine. I've modified the syntax script above.
(I presume the second hi clear in your comment was meant to by syn clear.) -- DavidOcallaghan 2006-08-14 16:03:26
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
- I use mozex and (g)vim7. When it launch the gvim, the editor lost my colors configured in .vimrc, but I can set it manually.
other VimHighlighting sources
I just stumbled across this after having written my own MoinMoin syntax file. I'm no VIM guru, so my solution is probably a bit crude, but it offers a slightly different formatting style (including subtly different formatting for different heading levels).
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