literate haskell syntax highlighting issues in vim (Re: [Haskell-cafe] OK, so this VIM thing -- how do I make it actually work?)

Claus Reinke claus.reinke at
Tue Jun 5 08:28:14 EDT 2007

>>    clearly.)  The problems I'm seeing are the ugly white-on-red for
>>    underlines, the lack of any kind of differentiation for
> You can also put your cursor an those underlines and use
>  :echo synIDattr(synID(line("."), col("."), 1), "name")

looks like a highlighting bug alright. reduced example:

------------------------ H.lhs:

% \section{one}

data D_e = D String deriving Show

% \section{two}

data D_e = D String deriving Show


as it is, the first code line is haskell-highlighted, the "_" is part of 
a "ConId"; the second code line is tex-highlighted, the "_" becomes 
a "texOnlyMath", and is highlighted as a syntax error (red).

if i uncomment the "\section{one}", haskell-highlighting disappears,
everything is now part of a "texSectionZone", and highlighted as
such, including tex syntax error highlights. 

if i now register code-sections as "texZone" (the zone "tex.vim" 
uses for "verbatim"), with haskell contents, both code lines are
haskell-highlighted, so the "texSectionZone" has been interrupted..

:syn region texZone start="\\begin{code}" end="\\end{code}" contains=@haskellTop

if i now uncomment the "\section{two}", a new "texSectionZone"
is started there (might need a resync), and both code lines are 
highlighted correctly (the first as haskell, the second as -buggy- 

"tex.vim" has several zones with no real end marker ("\section",
"\chapter", ..), and it seems that "tex.vim" and "lhaskell.vim" do
not interact properly. 

since this list is given as the maintainer for "lhaskell.vim": any 
literate haskellers out here who'd like to try fixing that?-)


More information about the Haskell-Cafe mailing list