sponsor Vim development Vim logo Vim Book Ad

nuweb multi-language : Syntax highlight for NUWEB (Literate Programming), multi-language version

 script karma  Rating 4/3, Downloaded by 485  Comments, bugs, improvements  Vim wiki

created by
Ahmed Fasih
 
script type
syntax
 
description
Almost entirely derived from by Patricio Toledo's original syntax file (http://www.vim.org/scripts/script.php?script_id=543) which highlits NUWEB scraps without any language-dependent syntax highlighting. I modified it in the following ways:
1) Scraps beginning with "@{/* C */" will be highlit as C
2) Scraps beginning with "@{# Python" will be highlit as Python.
3) For all other scraps, the opening "@{" must be followed by a newline.

It's very easy to extend this syntax file to handle other languages. If someone else could fix #3, so that "@{anything@}" scraps could work without a newline following "@{", I'd appreciate it. Also, other ideas on doing multi-language highlighting are welcome.
 
install details
Download to your system syntax/ directory or into ~/.vim/syntax/.

As .w is used by CWEB, I suggest using .nw as your NUWEB extension. Add the following to your filetype.vim:
'au BufNewFile,BufRead *.nw      setf nuweb'
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
nuweb.vim 0.2 2009-08-19 6.0 Ahmed Fasih Initial upload
ip used for rating: 3.138.105.31

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github