groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] A vim syntax file for [tg]roff


From: Paco Andres Verdu
Subject: Re: [Groff] A vim syntax file for [tg]roff
Date: Fri, 1 Sep 2000 19:20:05 +0200 (CEST)

Hi baruchel,

On Tue, 29 Aug 2000, baruchel wrote:


> I asked for a vim syntax file some days ago. I has no answer and couldn't
> manage to find one. I begun to write my own. It's not perfect, but comfortable
> enough to edit troff/groff files (with -ms macros). The best part is probably

        Have you tried the nroff syntax ?, I'm using it to edit gtroff files 
(with the me macros) and it works for me. I've attached the syntax file to this
message, but since it came with my vim package (on a Debian 2.1 system)
maybe you have it already.

> Try it. If you find it useful, i'd be happy. If you know another one, tell me.

        I haven't tested it yet, but yours seems more complete (at least
bigger ;-) ) than the nroff one, so I think it could be a very valuable
addition to my toolset, please keep us informed of new additions to this
file. Thanks


Greetings

Paco

--
                              Saludos
-----------------------------------------------------------------------------
Paco Andrés Verdú                                     address@hidden
Alicante (Spain)                                              

" VIM syntax file
" Language: Nroff/Troff
" Maintainer: Matthias Burian <address@hidden>
" Last change: Aug. 18, 1998
"
syn clear

syn match nroffCommand "^\.[a-zA-Z]" nextgroup=nroffCmdArg
syn match nroffCommand "^\.[a-zA-Z][a-zA-Z0-9\\]" nextgroup=nroffCmdArg
syn match nroffCmdArg contained ".*" contains=nroffString,nroffComArg
syn region nroffString contained start=/"/ end=/"/ contains=nroffFont
syn region nroffString contained start=/'/ end=/'/ contains=nroffFont
syn match nroffComArg +\\".*+
syn match nroffComment +^\.\\".*+
syn region nroffFont start="\\f[A-Z]"hs=s+3 end="\\f[A-Z]"he=e-3 end="$"
syn region nroffFont start="\\\*<"hs=s+3 end="\\\*>"he=e-3
syn region nroffDefine start="\.ds\ [A-Za-z_]\+" end="$" contains=ALL 
syn region nroffSize start="\\s[0-9]*" end="\\s[0-9]*"
syn region nroffSpecial start="^\.[TP]S$" end="^\.[TP]E$"
syn region nroffSpecial start="^\.EQ$" end="^\.EN$"

if !exists("did_nroff_syntax_inits")
  let did_nroff_syntax_inits = 1
  " The default methods for highlighting.  Can be overridden later
  hi link nroffCommand                  Statement
  hi link nroffComment                  Comment
  hi link nroffComArg                   Comment
  hi link nroffFont                     PreProc
  hi link nroffSize                     PreProc
  hi link nroffDefine                   String
  hi link nroffString                   String
  hi link nroffSpecial                  Question
endif

let b:current_syntax = "nroff"

" vim: ts=8

reply via email to

[Prev in Thread] Current Thread [Next in Thread]