[Gllug] vim syntax

Jonathan Dye jonathan.dye at automationpartnership.com
Thu Apr 11 08:35:51 UTC 2002

At 10:33 11/04/02 +0100, you wrote:
>On Thu, 11 Apr 2002, Jonathan Dye wrote:
>> 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

The comments varible was what I wanted and it works fine now.

>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

Should have known to look there really, return problem solved by adding r
and while I was at it I added o too.



This message has been checked for all known viruses by the 
MessageLabs Virus Scanning Service

Gllug mailing list  -  Gllug at linux.co.uk

More information about the GLLUG mailing list