vim syntax highlighting is messed up after non-standard delimiters in Perl's s///
When I have something like 开发者_运维技巧s#hello#bye#;
in my Perl script vim's syntax highlighting is messed up after that line. It only works correctly if I use /
as the delimiter, as in s/hello/bye/;
. Does anyone know if/how I can fix this?
Thanks a lot in advance for your replies.
My Debian packaged vim 7.1 highlights OK with s#foo#bar#g. The Debian package does not contain vim's perl-specific features.
Also, no problem with RHEL vim 7.0 which has perl features enabled.
I remember seeing this problem with syntax highlighing some time back, so it might be your vim version and/or perl syntax highlighting rules.
"The only thing that can parse Perl is perl."
But seriously, Perl has a massively irregular grammar and it's not surprising that it confuses some syntax highlighters. The most successful one I've seen is CPerl mode for Emacs. But I guess that's not particularly useful for a Vim user.
精彩评论