noweb.vim : A syntax file for noweb, with separate highlighting for documentation and code
script karma |
Rating 35/14,
Downloaded by 1532 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Michael McDermott |
|
script type |
syntax |
|
description |
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:
noweb_backend
noweb_language
noweb_fold_code
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. |
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 44.220.255.141
|