On 6/7/06, Robert Hicks <[EMAIL PROTECTED]> wrote:
In Tcl if you do this:
if {0} {
Other code you want to comment
out is in here.
}
That if statement works just like a multi-line comment (i.e. /* */ ) in
other languages.
Is it possible to color that the same way as a comment?
1. Must be possible because in C syntax, there is an option for
coloring '#if 0'\n...#endif' blocks as comments. In C syntax,
it's optional. You can switch it on/off by setting/unsetting the
variable g:c_no_if0 in your vimrc.
2. Now to the question whether existing tcl.vim (syntax) has such thing.
I don't see it in vim6.4. (I dont have vim7 on this computer).
3. You could either ask tcl.vim syntax maintainer,
Dean Copsey <[EMAIL PROTECTED]>, to add it, or
flex your syntax muscles and do it yourself by analogy with how
C colors '#if 0'\n...#endif' blocks. Here is how c.vim does it:
------------------------------------------------
if !exists("c_no_if0")
syn region cCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end="[EMAIL
PROTECTED]|$
" contains=cCppOut2
syn region cCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif
\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip
syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>
\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>"
contains=cSpaceError,cCppSkip
endif
-------------------------------------------------
Yakov