[Gllug] vim syntax

Richard Cohen richard at vmlinuz.org
Thu Apr 11 09:33:33 UTC 2002

On Thu, 11 Apr 2002, Jonathan Dye wrote:

> Hi,
> I've written my own syntax file for some custom configuration files we have
> here and everything works nicely.  What I want to add however is for vim to
> properly continue comments when using gq (or reaching the textwidth limit).
> The coments start with a ; and continue to the end of the line.
> I don't know if this intelligence is based on syntax rules or something
> else but it works OK for c comments.
> My syntax line is:
> syn region rgxComment start=";" end="$"
> Actually, while I'm writing about this, is there a way to get vim to
> continue the comment properly (in c/c++) when pressing return in the
> comment?  It works OK when I run over the text width limit.

Have a look at :help on comments and format-comments - I'm looking at vim
6.1, FWIW

You may/will also need some or all of the r,o,c options set in the
formatoptions variable (:help fo).  ":help 30.6" will take you to the right
chapter in the user manual - again, at least in vim 6.1

> JD


Gllug mailing list  -  Gllug at linux.co.uk

More information about the GLLUG mailing list