New syntax files need feedback

bilibop project quidame at
Sun Sep 30 00:32:05 UTC 2012

Hi, Vincent

> Out of curiousity, I did give this a try, and ended up with the following:
> $ vim "+syntax on" "+set ft=conky" ~/.conkyrc
> "~/.conkyrc" 228L, 11415C
> Error detected while processing /home/vincent/.vim/syntax/conky.vim:
> line    5:
> E492: Not an editor command: ^M
> line    8:
> E15: Invalid expression: !exists("main_syntax")^M
> line  329:
> E171: Missing :endif
> Press ENTER or type command to continue
> (and vim didn't highlight anything in my conkyrc...)

Hmm... I suspect the conky.vim attachment has been modified on your side,
maybe opened with a 'dos' editor, and ^M (carriage return) have been (silently?)
added at the end of each line.  In all cases, this does not come from my side:
the file I have attached with my post has md5sum:
Yours, probably has md5sum: 

If it is the case, you can just type:
$ sed -i 's/^M$//' ~/.vim/syntax/conky.vim
(Note that to obtain a litteral <Ctrl-M> (^M), type <Ctrl-V><Ctrl-M>.
This should work, unless you have tweaked your inputrc settings.)

or, if you prefer to learn a little bit of Vim's black magic:
$ vim ~/.vim/syntax/conky.vim

And then,
:set ff?

It should return 'fileformat=dos', so:
:set ff=unix

and retry
$ vim "+syntax on" "+set ft=conky" ~/.conkyrc

> Also, I've just realized that upstream seems to have a vim syntax file
> already in conky's source (look for extras/vim/syntax/conkyrc.vim in
> the source tarball, or via gitweb [1]). It might be a bit out of date
> though.
> Regards,
> Vincent
> [1];a=blob;f=extras/vim/syntax/conkyrc.vim

Thanks for your investigations.
Yes, it is a bit out of date (2006). There are some 'new' options now, and some
options (as mysql_*) seem to have been removed (my conky.vim has been written
by refering to the conky(1) manual page). And above all, this old file does not
really manage important things, such as a lot of possible syntax errors, or even
comments on the same line than settings.

To compare conky.vim and conkyrc.vim from vim itself,
you can open a conkyrc file in vim and toggle syntax highlightings with:
:set ft=conky
:set ft=conkyrc
Feedback is welcome


More information about the pkg-vim-maintainers mailing list