[Mapserver-users] vim syntax file

Andreas Hirner andreas_hirner at hotmail.com
Wed May 26 02:36:12 PDT 2004


This is a multi-part message in MIME format.

------=_NextPart_000_115b_5804_7070
Content-Type: text/plain; format=flowed

Hello List,

I have written a syntax file for vi/vim. It was my first go at vim syntax 
files and only represents a first draft. I am sure there is still plenty of 
room for improvements. The keywords are based on the TextPad Symbol 
Map_40.syn file contributed by Christopher Thorne, which can be found on the 
Mapserver utility page.

To register this file in vim copy map.vim (also listed at the bottom of the 
mail) to the vim syntax directory (on Suse: /usr/share/vim/current/syntax) 
and add two lines to filetype.vim (on Suse Linux: /usr/share/vim/current) 
according to the example shown below:


" Manpage
au BufNewFile,BufRead *.man         setf man
############ADD#############
" Map
au BufNewFile,BufRead *.map         setf map
############ADD#############
" Maple V
au BufNewFile,BufRead *.mv,*.mpl,*.mws      setf maple

I hope the file is somehow usefull to anybody out there. If there are any 
questions or suggestions, please feel free to contact me.

Cheer
Andreas

-----------------------------------------

Dr. Andreas Hirner

German Remote Sensing Data Center (DFD)
German Aerospace Center (DLR)

P.O.Box 11 16       Tel: +49-8153-28-3389
D-82234 Wessling    Fax: +49-8153-28-1445
Germany

E-mail: andreas.hirner at dlr.de

-----------------------------------------


##########################
map.vim
##########################
" Vim syntax file
" Language:		map (umn mapserver config file)
" Maintainer:   Andreas Hirner <andreas.hirner at dlr.de>
" Last Change:  $Date: 2004/05/25 19:19:37 $
" Filenames:    *.map
" URL:			ftp://xxx@xxx.xx/map.vim
" Note:			The definitions below are taken from TextPad syntax definitions 
(*.syn) by Chris Thorne (thorne at dmsolutions.ca) as of May 2004, for version 
4.0 Mapserver

" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
  syntax clear
elseif exists("b:current_syntax")
  finish
endif

" Always ignore case
syn case ignore

" General keywords first order
syn keyword mapDefine 		CLASS END JOIN LABEL LAYER LEGEND MAP METADATA 
OUTPUTFORMAT
syn keyword mapDefine 		PROJECTION QUERYMAP REFERENCE SCALEBAR STYLE SYMBOL 
WEB

" General keywords second order
syn keyword mapIdentifier	ALPHACOLOR ANGLE ANTIALIAS
syn keyword mapIdentifier	BACKGROUNDCOLOR BACKGROUNDSHADOWCOLOR 
BACKGROUNDSHADOWSIZE BUFFER
syn keyword mapIdentifier	CHARACTER CLASSITEM COLOR CONNECTION 
CONNECTIONTYPE
syn keyword mapIdentifier	DATA DATAPATTERN DEBUG DRIVER DUMP
syn keyword mapIdentifier	EMPTY ERROR EXPRESSION EXTENSION EXTENT
syn keyword mapIdentifier	FEATURE FILLED FILTER FILTERITEM FONT FONTSET 
FOOTER FORCE FORMATOPTION FROM
syn keyword mapIdentifier	GAP GRATICULE GRID GROUP HEADER
syn keyword mapIdentifier	IMAGE IMAGECOLOR IMAGEMODE IMAGEPATH IMAGEQUALITY 
IMAGETYPE IMAGEURL INDEX INTERLACE INTERVALS
syn keyword mapIdentifier	KEYIMAGE KEYSIZE KEYSPACING
syn keyword mapIdentifier	LABELANGLEITEM LABELCACHE LABELFORMAT LABELITEM 
LABELMAXSCALE LABELMINSCALE LABELREQUIRES LABELSIZEITEM LATLON LINECAP 
LINEJOIN LINEJOINMAXSIZE LOG
syn keyword mapIdentifier	MARKER MARKERSIZE MAXARCS MAXBOXSIZE MAXFEATURES 
MAXINTERVAL MAXSCALE MAXSIZE MAXSUBDIVIDE MAXTEMPLATE MIMETYPE
syn keyword mapIdentifier	MINARCS MINBOXSIZE MINDISTANCE MINFEATURESIZE 
MININTERVAL MINSCALE MINSIZE MINSUBDIVIDE MINTEMPLATE
syn keyword mapIdentifier	NAME
syn keyword mapIdentifier	OFFSET OFFSITE OUTLINECOLOR OVERLAYBACKGROUNDCOLOR 
OVERLAYCOLOR OVERLAYMAXSIZE OVERLAYMINSIZE OVERLAYOUTLINECOLOR OVERLAYSIZE 
OVERLAYSYMBOL
syn keyword mapIdentifier	PARTIALS POINTS POSITION POSTLABELCACHE PROCESSING
syn keyword mapIdentifier	REQUIRES RESOLUTION
syn keyword mapIdentifier	SCALE SHADOWCOLOR SHADOWSIZE SHAPEPATH SIZE 
SIZEUNITS STATUS STYLEITEM SYMBOLSCALE SYMBOLSET
syn keyword mapIdentifier	TABLE TEMPLATE TEMPLATEPATTERN TEXT TILEINDEX 
TILEITEM TITLE TO TOLERANCE TOLERANCEUNITS TRANSFORM TRANSPARENCY 
TRANSPAREN[T] TYPE
syn keyword mapIdentifier	UNITS WMS_ABSTRACT WMS_ACCESSCONSTRAINTS 
WMS_ONLINERESOURCE WMS_SRS WMS_TITLE WRAP

" General keywords third order
syn keyword mapKeyword		ANNOTATION AUTO BEVEL BITMAP BUTT
syn keyword mapKeyword		CARTOLINE CC CIRCLE CL CR CSV DD DEFAULT
syn keyword mapKeyword		ELLIPSE EMBED FALSE FEET GIANT HILITE INCHES
syn keyword mapKeyword		KILOMETERS LARGE LC LINE LL LR
syn keyword mapKeyword		MEDIUM METERS MILES MITER MULTIPLE MYGIS NORMAL
syn keyword mapKeyword		OFF OGR ON ONE-TO-MANY ONE-TO-ONE ORACLESPATIAL
syn keyword mapKeyword		PIXELS PIXMAP POINT POLYGON POSTGIS QUERY RASTER 
ROUND
syn keyword mapKeyword		SDE SELECTED SIMPLE SINGLE SMALL SQUARE
syn keyword mapKeyword		TINY TRIANGLE TRUE TRUETYPE UC UL UR VECTOR WFS WMS

" keywords for other purposes
syn keyword mapTypedef		SELECTION

" Comment
syn match mapComment		"#.*"

" Strings (single- and double-quote)
syn region mapString		 start=+"+  skip=+\\\\\|\\"+  end=+"+
syn region mapString		 start=+'+  skip=+\\\\\|\\'+  end=+'+

" Numbers and hexidecimal values
syn match mapNumber			"-\=\<[0-9]*\>"
syn match mapNumber			"\<0x[abcdefABCDEF0-9]*\>"

" Operators
syn match mapOperator		"EQ"
syn match mapOperator		"[><|\=&!$/\\()\[\]]"


" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_map_syn_inits")
  if version < 508
    let did_map_syn_inits = 1
    command -nargs=+ HiLink hi link <args>
  else
    command -nargs=+ HiLink hi def link <args>
  endif

  HiLink mapComment		Comment
  HiLink mapKeyword		Keyword
  HiLink mapIdentifier	Identifier
  HiLink mapDefine		Define
  HiLink mapTypedef		Typedef
  HiLink mapNumber		Number
  HiLink mapString		String
  HiLink mapOperator	Operator

  delcommand HiLink
endif

let b:current_syntax = "map"

" vim: ts=8

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail

------=_NextPart_000_115b_5804_7070
Content-Type: application/octet-stream; name="map.vim"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="map.vim"

IiBWaW0gc3ludGF4IGZpbGUKIiBMYW5ndWFnZToJCW1hcCAodW1uIG1hcHNl
cnZlciBjb25maWcgZmlsZSkgCiIgTWFpbnRhaW5lcjogICBBbmRyZWFzIEhp
cm5lciA8YW5kcmVhcy5oaXJuZXJAZGxyLmRlPgoiIExhc3QgQ2hhbmdlOiAg
JERhdGU6IDIwMDQvMDUvMjUgMTk6MTk6MzcgJAoiIEZpbGVuYW1lczogICAg
Ki5tYXAKIiBVUkw6CQkJZnRwOi8veHh4QHh4eC54eC9tYXAudmltCiIgTm90
ZToJCQlUaGUgZGVmaW5pdGlvbnMgYmVsb3cgYXJlIHRha2VuIGZyb20gVGV4
dFBhZCBzeW50YXggZGVmaW5pdGlvbnMgKCouc3luKSBieSBDaHJpcyBUaG9y
bmUgKHRob3JuZUBkbXNvbHV0aW9ucy5jYSkgYXMgb2YgTWF5IDIwMDQsIGZv
ciB2ZXJzaW9uIDQuMCBNYXBzZXJ2ZXIKCiIgRm9yIHZlcnNpb24gNS54OiBD
bGVhciBhbGwgc3ludGF4IGl0ZW1zCiIgRm9yIHZlcnNpb24gNi54OiBRdWl0
IHdoZW4gYSBzeW50YXggZmlsZSB3YXMgYWxyZWFkeSBsb2FkZWQKaWYgdmVy
c2lvbiA8IDYwMAogIHN5bnRheCBjbGVhcgplbHNl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More information about the MapServer-users mailing list