Wednesday, November 11, 2009

Reader Question: MMM Mode?

Chris Keating writes:

"Could you ask your readership if there's a vim equivalent for emacs MMM mode:
http://mmm-mode.sourceforge.net/

mmm mode basically allows you to have different syntax highlighting for different parts of your document. This is really handy when you have SQL embedded in strings, etc."


Anybody have any ideas?

2 comments:

graywh said...

Take a look at syntaxes that do this already like PHP, Erb, rnoweb, etc. The key is using :syn-include. Just don't follow the help's example of using <sfile>:p:h/included.vim and instead use syntax/included.vim

Alex said...

http://vim.wikia.com/wiki/Different_syntax_highlighting_within_regions_of_a_file

Didn't do it myself, not enough advanced user