" syntax file for vim: ts=8 sw=4 et: " " Language: Lweb " Original Author: Christian Lindig " Changes for Lweb: Dimitris Michail " Last Change: Thu Nov 04 23:00 CET 2004 " Remark: Includes tex, cpp " " An Lweb file typically uses LaTeX for markup plus C++ language. " " Put this file into ~/.vim/after/syntax/lweb.vim and the following " into .vimrc: " " au! BufNewFile,BufRead *.lw setf lweb " " or create a ~/.vim/after/filetype.vim containing the following " " augroup filetypedetect " au BufNewFile,BufRead *.lw setf lweb " augroup END " " The nowebXX region marks a regions between |bars|. I'm using a non-standard " style file that renders these region as verbatim. You might want to comment " this defintion out. runtime! syntax/tex.vim unlet b:current_syntax syn include @Noweb syntax/cpp.vim " or any other language syn region nowebTT start="\[\["hs=s+2 end="\]\]"he=e-2 syn region nowebXX start="|"hs=s+1 end="|"he=e-1 syn region nowebName start="<<" end=">>" oneline contains=nowebTT syn region nowebCode start="^<<.*>>=" end="^@" contains=nowebName, @Noweb " a region marked by %%no syntax .. %%end is rendered as nowebNone. Use " this to effectively switch off syntax highlighting for a limited region. syn region nowebNone start="^%%no syntax *$" end="^%%end *$" hi def link nowebName String hi def link nowebTT Constant hi def link nowebXX Constant hi def link nowebNone Constant " hi def link nowebCode Special " use, if @Noweb undefined let b:current_syntax="lweb"