[Mapserver-users] vim syntax file

Tyler Mitchell TMitchell at lignum.com
Wed May 26 08:45:01 PDT 2004


Andreas,
Beautiful, thanks for sharing.  Works with vim for windows fine.

Tyler

mapserver-users-admin at lists.gis.umn.edu wrote on 05/26/2004 02:36:12 AM:

> 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
> [attachment "map.vim" deleted by Tyler Mitchell/Lignum] 



More information about the MapServer-users mailing list