Re: [Vim-latex-devel] Custom verbatim-like environment
Brought to you by:
srinathava,
tmaas
From: rocku <ro...@gm...> - 2009-08-22 13:59:50
|
Aditya Mahajan pisze: >> I don't want to use the listings package as it would be just overkill to >> what I am trying to do. I thought more of a workaround, possibly some >> patch to latex-suite to force verbatim-like behavior to my 'code' >> environment. I scanned throught the sources, but couldn't figure out how >> latex-suite ignores verbatim environment. I am not familiar with vim's >> script language, though. > > You can you %stopzone to avoid the syntax highlighting from overrunning. > For example > > \begin{code} > $whatever > \end{code}%stopzone Thanks, that solved it. Altought I have to put %stopzone on the next line because otherwise fancyvrb prints a error: error| FancyVerb Error: Extraneous input ` %stopzone\end{}' between \end{code} and line end > should work. The syntax highlighting inside the code is still wrong, but > at least it will not overflow. > > Another option is to open $VIMRUNTIME/syntax/tex.vim and search for > verbatim. You will see a sequence of lines like. > > syn region texZone start="\\begin{verbatim}" > end="\\end{verbatim}\|%stopzone\>" contains=@Spell > > Add another similar line replacing verbatim with code. That will make > the code environment behave like the verbatim environment. I also tried this and it works! I'll stick to this solution. Thanks! -- rocku |