Re: (G)Vim Oddity
2005/12/20, Paolo Pantaleo <email@example.com>:
> 2005/12/20, Joris Huizer <firstname.lastname@example.org>:
> > Heimdall Midgard wrote:
> > > I just noticed something weird with my (G)Vim
> > > installation when editing generic config files. The
> > > syntax highlighting colors appear wrong. Could
> > > somebody do a test to confirm if this is really a bug
> > > or just a misconfiguration on my end?
> > Seeing this too... but I do not know much about gvim
> > highlighting so I can only attach my ~/.vimrc to help ?
> > (no system-wide changes made)
Joris: I'll look into setting up a proper ~/.*vimrc. The
only thing I have in is "syntax on" in my ~/.vimrc and and
"set guifont=Bitstream\ Vera\ Sans\ Mono\ 14" in ~/.gvimrc.
The thing is (g)vim appears to work out of the box with the
files I usually work with (mostly HTML with some tcsh scripts).
> 1) what version ov vim?
Paolo: It appears to be 6.4 (Debian Unstable version).
> 2) syntax realted things are in
> how vim identify a file type shold be written in
> anyway i do not think it is a bug. What files are supposed
> to be the two you created? they have not a recognizable
> syntax. It is just that vim thinks that your file is of a
> certain type and the related syntax highlight is applied.
Actually the tests were simply designed to mimick the
behavior (g)vim was already displaying when I was editing my
/etc/udev/rules.d/001_custom.rules. The highlighting appears
to be better behaved if I renamed the file to, say,
"001_custom.sh" (at least the comments are colored
But surely in *n*x you can't assume what a file is on the
basis of its extension?
Actually there's something more sinister behind this. I
first noticed this while editing (using vim as root) my
custom udev rules. After I saved the file, some lines were
apparently not being read by udev. These were the same lines
that vim would not color or highlight correctly if I put a
"#" at the beginning of the line.
At present my udev rules file consists of a weird tangle of
rules and blank comment lines (a pure blank line would do as
well). In schematic form the problem would appear like this:
# My UDEV rules
So I was trying to cover all bases. I know it it's
unlikely. But is vim inserting some hidden, non-ASCII
characters? Is it simply a udev bug? Or a more general
locale bug that happens to affect both udev and vim?
Albert Einstein: Phantasie ist wichtiger als Wissen, denn
Wissen ist begrenzt.