On 17/05/11 02:55, AMDx64BT wrote:
I would like to highlight 2 o more different syntax in the same file.
For example, I have a file with notes with different languages cpp,
matlab, python, bash and I would like to be able to highlight each
syntax with colors. Any ideas?

It is possible as long as _either_ the new syntax extends the "included" syntax, like C++ extends C, _or_ you can tell Vim how to find out which parts must be highlighted according to which syntax. There are examples in the standard syntax scripts distributed with Vim, here are a few:

- Vim scripts ("vim" syntax) may include here-documents in lua, scheme, perl, python, ruby or tcl syntax.

- HTML pages may include <style> tags (which contain CSS rules) and <script> tags (which may contain JavaScript statements).

See
        :help :syn-include
        :view $VIMRUNTIME/syntax/cpp.vim
        :view $VIMRUNTIME/syntax/vim.vim
        :view $VIMRUNTIME/syntax/html.vim

Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
90. Instead of calling you to dinner, your spouse sends e-mail.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to