sponsor Vim development Vim logo Vim Book Ad

noweb.vim : A syntax file for noweb, with separate highlighting for documentation and code

 script karma  Rating 34/13, Downloaded by 1394  Comments, bugs, improvements  Vim wiki

created by
Michael McDermott
script type
This is a simple syntax for noweb. Basically, it is a nice way to view code and documentation with separate syntax highlighting. Also, it can autofold code blocks.

The script uses the following options:


Set noweb_backend to the basename of the syntax file you want to use, minus the \".vim\" extension. So, for TeX, you would:

let noweb_backend = \"tex\"

noweb_language is similar, but is used to highlight the contents of code blocks. So, for example:

let noweb_language = \"cpp\"

Makes the syntax for code snippets = C++.

Finally, there is noweb_fold_code, which sets whether or not code blocks should be automatically folded. If 1, then they will be folded. Otherwise, not.
install details
Just copy the script to your ~/.vim/syntax directory.

Optionally, add something like this to your ~/.vimrc:

filetype on
filetype plugin on

au BufRead,BufNewFile *.nw    set filetype=noweb

let noweb_backend = \"tex\"
let noweb_language = \"cpp\"
let noweb_fold_code = 1

This will set the script to run for .nw files, assuming a documentation backend of TeX, a code language of C++, and turns on automatic code chunk folding.

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
noweb.vim 0.2 2010-06-30 7.0 Michael McDermott Added a patch from Matt Edlefsen fixing a syntax highlighting idiosyncrasy.
noweb.vim 0.1 2010-04-01 7.0 Michael McDermott Initial upload
ip used for rating:

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