VIM and Literate programming

Sep 10, 2010 13:20

Recently I started using Noweb literate programming tool for my C projects. The resulting code is self-documented, easy to read and well-structured. I've chosen Noweb over other tools (primarily, Donald Knuth's CWEB) because of its simplicity and language independence.
The only thing that I needed to effectively use Noweb was some editor support. Noweb, when used with C, usually looks like TeX mixed with C code. So there's a plug-in for VIM, that enables usage of both syntaxes in one file and folding Noweb sections.
However, there's a little problem with Noweb plug-in for VIM. It breaks both completion and tags in your C code embedded in Noweb source. Keywords break up to single words on underscore symbol. I figured out that this is because of TeX syntax file modifies iskeyword variable, removing underscore from it.
So, finally, to fix it, you need to add the following to noweb.vim:

setlocal iskeyword=@,48-57,192-255,_

completion, vim, literate programming, noweb

Previous post Next post
Up