Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of rafael (2125)

Friday September 06, 2002
10:53 AM

Not using colors in vim

[ #7570 ]
Ask writes in his weblog that he disables color markup in his editor (and gives good reasons for doing so). I don't disable it, but only because I took some time to have a color configuration that works for me. But this can raise a problem for vim users :

I'm the author of a vim script distributed with recent vims that helps to reindent perl code while typing. I find it very useful. But it doesn't function as well when syntax highlighting isn't enabled, because it looks up the current syntax group for hints on how to reindent (e.g. it doesn't perform any reindentation in the middle of a here-doc or of a POD paragraph.)

So what to do if you want smart perl indentation without perl coloring ?

Answer : revert all color groups to "Normal", as the following little vim script does :

so $VIMRUNTIME/syntax/perl.vim
redir @x
silent highlight
redir END
new
put x
v/^\(perl\|pod\)/d
%s/ xxx.*/ Normal/
%s/^/hi link /
%y x
silent @x
q!
noh

(This can be pasted into one's .vimrc. To be more extensively tested, and put somewhere else, where interested parties can find it.)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.