Wikia

Vim Tips Wiki

Clearmoments/celssc

Talk0
1,613pages on
this wiki

< User:Clearmoments

Revision as of 19:30, May 1, 2008 by Clearmoments (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

celssc.vimEdit

" Vim syntax file
" Language:         Celestia Solar System Catalog
" Maintainer:       n/a
" Latest Revision:  27 April 2008

if exists("b:current_syntax")
  finish
endif





"-----------------------------------------------------------------/
"   Celestia comments
"-----------------------------------------------------------------/


syn keyword celestiaSSTodo contained TODO FIXME XXX NOTE
syn match celestiaSSComment "#.*$" contains=celestiaSSTodo





"-----------------------------------------------------------------/
"   Celestia file types
"-----------------------------------------------------------------/


"----------------------------------------------------------------/
"       Celestia numbers used in blocks
"----------------------------------------------------------------/

"   Regular int like number with - + or nothing in front
"       e.g. 918, or -49

syn match celestiaSSNumber '\d\+' contained display
syn match celestiaSSNumber '[-+]\d\+' contained display

"   Floating point number with decimal no E or e (+,-)
"       e.g. 0.198781, or -3.141592

syn match celestiaSSNumber '\d\+\.\d*' contained display
syn match celestiaSSNumber '[-+]\d\+\.\d*' contained display

"   Floating point like number with E and no decimal point (+,-)
"       e.g.    3E+9, 3e+09, or -3e+02

syn match celestiaSSNumber '[-+]\=\d[[:digit:]]*[eE][\-+]\=\d\+' contained display
syn match celestiaSSNumber '\d[[:digit:]]*[eE][\-+]\=\d\+' contained display

"   Floating point like number with E and decimal point (+,-)
"       e.g.    -3.9188e+09, or 0.9188E-93

syn match celestiaSSNumber '[-+]\=\d[[:digit:]]*\.\d*[eE][\-+]\=\d\+' contained display
syn match celestiaSSNumber '\d[[:digit:]]*\.\d*[eE][\-+]\=\d\+' contained display

"   True false bools
syn keyword celestiaSSBool true false

"   Array blocks only contain numbers
syn region celestiaSSArrayBlock oneline start='\[' end='\]' transparent contains=celestiaSSNumber

"   This is a description block
syn region celestiaSSDescBlock start="{" end="}" fold transparent contains=ALLBUT,celestiaSSDescString,celestiaSSObjectPath,celestiaSSMainKw

"   This is a description string, not anything
syn region celestiaSSDescString oneline start='"' end='"' nextgroup=celestiaSSObjectPath

"   This is a 
syn region celestiaSSObjectPath oneline start='"' end='"' nextgroup=celestiaSSDescBlock

"   This is a regular string contained within a description block
syn region celestiaSSString oneline start='"' end='"' contained

"   This is an Url string 
syn region celestiaSSUrlStr oneline start='"[A-Za-z][A-Za-z]*://[A-Za-z0-9%_/][A-Za-z0-9%_/]*' end='"' contained





"----------------------------------------------------------------------------/
"   Celestia keywords
"----------------------------------------------------------------------------/


"------------------------------------------/
"   Atmosphere description
"------------------------------------------/

syn keyword celestiaSSAtmosphCmd CloudSpeed CloudHeight Height         nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSAtmosphCmd Lower Upper SpecularColor Sky         nextgroup=celestiaSSArrayBlock skipwhite
syn keyword celestiaSSAtmosphCmd Sunset Rayleigh                       nextgroup=celestiaSSArrayBlock skipwhite
syn keyword celestiaSSAtmosphCmd CloudMap                              nextgroup=celestiaSSString skipwhite

"-----------------------------------------/
"   Ellipse orbit descriptor
"-----------------------------------------/

syn keyword celestiaSSEllOrbitCmd Albedo ArgOfPericenter AscendingNode nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSEllOrbitCmd Eccentricity Epoch Inclination       nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSEllOrbitCmd LongOfPericenter Mass                nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSEllOrbitCmd MeanAnomaly MeanLongitude            nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSEllOrbitCmd PericenterDistance Period            nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSEllOrbitCmd SemiMajorAxis                        nextgroup=celestiaSSNumber skipwhite

"-----------------------------------------------------------------------------/
"   Location sections
"-----------------------------------------------------------------------------/

syn keyword celestiaSSLocationCmd Importance Size                      nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSLocationCmd Type                                 nextgroup=celestiaSSString skipwhite
syn keyword celestiaSSLocationCmd LongLat                              nextgroup=celestiaSSArrayBlock skipwhite 

syn keyword celestiaSSUniformCmd MeridianAngle                         nextgroup=celestiaSSNumber skipwhite

syn keyword celestiaSSMainInnerKw Atmosphere EllipticalOrbit           nextgroup=celestiaSSDescBlock
syn keyword celestiaSSMainInnerKw UniformRotation                      nextgroup=celestiaSSDescBlock
syn keyword celestiaSSMainKw AltSurface ReferencePoint Location        nextgroup=celestiaSSDescString

syn keyword celestiaSSStdBlockCmd AbsMag AppMag Dec Distance           nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSStdBlockCmd Class CustomOrbit SpectralType       nextgroup=celestiaSSString skipwhite
syn keyword celestiaSSStdBlockCmd Color HazeColor Orientation          nextgroup=celestiaSSArrayBlock skipwhite

syn keyword celestiaSSStdBlockCmd Emissive                             nextgroup=celestiaSSBool skipwhite
syn keyword celestiaSSStdBlockCmd HazeDensity Importance               nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSStdBlockCmd EquatorAscendingNode Oblateness      nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSStdBlockCmd InfoURL                              nextgroup=celestiaSSUrlStr skipwhite
syn keyword celestiaSSStdBlockCmd Mesh NightTexture OrbitBarycenter    nextgroup=celestiaSSString skipwhite
syn keyword celestiaSSStdBlockCmd Obliquity PrecessionRate RA          nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSStdBlockCmd Radius RotationOffset RotationPeriod nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSStdBlockCmd SpectralType Texture Type            nextgroup=celestiaSSString skipwhite


"----------------------------------------------------------------------------/
"   Final setup
"----------------------------------------------------------------------------/


let b:current_syntax = "celssc"


"----------------------------------------------------------------------------/
"   Celestia keyword highlighting rules
"----------------------------------------------------------------------------/


hi def link celestiaSSAtmosphCmd   Statement
hi def link celestiaSSBool         Boolean
hi def link celestiaSSComment      Comment
hi def link celestiaSSDescString   PreProc
hi def link celestiaSSEllOrbitCmd  Statement
hi def link celestiaSSLocationCmd  Statement
hi def link celestiaSSHIPNumber    Type
hi def link celestiaSSMainInnerKw  Special
hi def link celestiaSSMainKw       Keyword
hi def link celestiaSSNumber       Constant
hi def link celestiaSSObjectPath   PreProc
hi def link celestiaSSStdBlockCmd  Statement
hi def link celestiaSSString       Constant
hi def link celestiaSSTodo         Todo
hi def link celestiaSSUrlStr       Underlined

Around Wikia's network

Random Wiki