Wikia

Vim Tips Wiki

Changes: User:Clearmoments/celssc

Edit

Back to page

(created page)
 
(celssc.vim: Removed tabs, changed spacinjg)
 
Line 1: Line 1:
 
 
==celssc.vim==
 
==celssc.vim==
 
<pre>
 
<pre>
Line 20: Line 19:
   
   
syn keyword celestiaSSTodo contained TODO FIXME XXX NOTE
+
syn keyword celestiaSSTodo contained TODO FIXME XXX NOTE
syn match celestiaSSComment "#.*$" contains=celestiaSSTodo
+
syn match celestiaSSComment "#.*$" contains=celestiaSSTodo
   
   
Line 33: Line 32:
   
 
"----------------------------------------------------------------/
 
"----------------------------------------------------------------/
" Celestia numbers used in blocks
+
" Celestia numbers used in blocks
 
"----------------------------------------------------------------/
 
"----------------------------------------------------------------/
   
 
" Regular int like number with - + or nothing in front
 
" Regular int like number with - + or nothing in front
 
" e.g. 918, or -49
 
" e.g. 918, or -49
syn match celestiaSSNumber '\d\+' contained display
+
syn match celestiaSSNumber '[-+]\d\+' contained display
+
syn match celestiaSSNumber '\d\+' contained display
  +
syn match celestiaSSNumber '[-+]\d\+' contained display
   
 
" Floating point number with decimal no E or e (+,-)
 
" Floating point number with decimal no E or e (+,-)
 
" e.g. 0.198781, or -3.141592
 
" e.g. 0.198781, or -3.141592
syn match celestiaSSNumber '\d\+\.\d*' contained display
+
syn match celestiaSSNumber '[-+]\d\+\.\d*' contained display
+
syn match celestiaSSNumber '\d\+\.\d*' contained display
  +
syn match celestiaSSNumber '[-+]\d\+\.\d*' contained display
   
 
" Floating point like number with E and no decimal point (+,-)
 
" Floating point like number with E and no decimal point (+,-)
 
" e.g. 3E+9, 3e+09, or -3e+02
 
" 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
+
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 (+,-)
 
" Floating point like number with E and decimal point (+,-)
 
" e.g. -3.9188e+09, or 0.9188E-93
 
" 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
+
syn match celestiaSSNumber '[-+]\=\d[[:digit:]]*\.\d*[eE][\-+]\=\d\+' contained display
  +
syn match celestiaSSNumber '\d[[:digit:]]*\.\d*[eE][\-+]\=\d\+' contained display
   
 
" True false bools
 
" True false bools
syn keyword celestiaSSBool true false
+
syn keyword celestiaSSBool true false
   
 
" Array blocks only contain numbers
 
" Array blocks only contain numbers
syn region celestiaSSArrayBlock oneline start='\[' end='\]' transparent contains=celestiaSSNumber
+
syn region celestiaSSArrayBlock oneline start='\[' end='\]' transparent contains=celestiaSSNumber
   
 
" This is a description block
 
" This is a description block
syn region celestiaSSDescBlock start="{" end="}" fold transparent contains=ALLBUT,celestiaSSDescString,celestiaSSObjectPath,celestiaSSMainKw
+
syn region celestiaSSDescBlock start="{" end="}" fold transparent contains=ALLBUT,celestiaSSDescString,celestiaSSObjectPath,celestiaSSMainKw
   
 
" This is a description string, not anything
 
" This is a description string, not anything
syn region celestiaSSDescString oneline start='"' end='"' nextgroup=celestiaSSObjectPath
+
syn region celestiaSSDescString oneline start='"' end='"' nextgroup=celestiaSSObjectPath
   
 
" This is a
 
" This is a
syn region celestiaSSObjectPath oneline start='"' end='"' nextgroup=celestiaSSDescBlock
+
syn region celestiaSSObjectPath oneline start='"' end='"' nextgroup=celestiaSSDescBlock
   
 
" This is a regular string contained within a description block
 
" This is a regular string contained within a description block
syn region celestiaSSString oneline start='"' end='"' contained
+
syn region celestiaSSString oneline start='"' end='"' contained
   
 
" This is an Url string
 
" 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
+
syn region celestiaSSUrlStr oneline start='"[A-Za-z][A-Za-z]*://[A-Za-z0-9%_/][A-Za-z0-9%_/]*' end='"' contained
   
   
Line 90: Line 89:
 
"------------------------------------------/
 
"------------------------------------------/
   
syn keyword celestiaSSAtmosphCmd CloudSpeed CloudHeight Height nextgroup=celestiaSSNumber skipwhite
+
syn keyword celestiaSSAtmosphCmd CloudSpeed CloudHeight Height nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSAtmosphCmd Lower Upper SpecularColor Sky nextgroup=celestiaSSArrayBlock skipwhite
+
syn keyword celestiaSSAtmosphCmd Lower Upper SpecularColor Sky nextgroup=celestiaSSArrayBlock skipwhite
syn keyword celestiaSSAtmosphCmd Sunset Rayleigh nextgroup=celestiaSSArrayBlock skipwhite
+
syn keyword celestiaSSAtmosphCmd Sunset Rayleigh nextgroup=celestiaSSArrayBlock skipwhite
syn keyword celestiaSSAtmosphCmd CloudMap nextgroup=celestiaSSString skipwhite
+
syn keyword celestiaSSAtmosphCmd CloudMap nextgroup=celestiaSSString skipwhite
   
 
"-----------------------------------------/
 
"-----------------------------------------/
Line 99: Line 98:
 
"-----------------------------------------/
 
"-----------------------------------------/
   
syn keyword celestiaSSEllOrbitCmd Albedo ArgOfPericenter AscendingNode nextgroup=celestiaSSNumber skipwhite
+
syn keyword celestiaSSEllOrbitCmd Albedo ArgOfPericenter AscendingNode nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSEllOrbitCmd Eccentricity Epoch Inclination nextgroup=celestiaSSNumber skipwhite
+
syn keyword celestiaSSEllOrbitCmd Eccentricity Epoch Inclination nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSEllOrbitCmd LongOfPericenter Mass nextgroup=celestiaSSNumber skipwhite
+
syn keyword celestiaSSEllOrbitCmd LongOfPericenter Mass nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSEllOrbitCmd MeanAnomaly MeanLongitude nextgroup=celestiaSSNumber skipwhite
+
syn keyword celestiaSSEllOrbitCmd MeanAnomaly MeanLongitude nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSEllOrbitCmd PericenterDistance Period nextgroup=celestiaSSNumber skipwhite
+
syn keyword celestiaSSEllOrbitCmd PericenterDistance Period nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSEllOrbitCmd SemiMajorAxis nextgroup=celestiaSSNumber skipwhite
+
syn keyword celestiaSSEllOrbitCmd SemiMajorAxis nextgroup=celestiaSSNumber skipwhite
   
 
"-----------------------------------------------------------------------------/
 
"-----------------------------------------------------------------------------/
Line 110: Line 109:
 
"-----------------------------------------------------------------------------/
 
"-----------------------------------------------------------------------------/
   
syn keyword celestiaSSLocationCmd Importance Size nextgroup=celestiaSSNumber skipwhite
+
syn keyword celestiaSSLocationCmd Importance Size nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSLocationCmd Type nextgroup=celestiaSSString skipwhite
+
syn keyword celestiaSSLocationCmd Type nextgroup=celestiaSSString skipwhite
syn keyword celestiaSSLocationCmd LongLat nextgroup=celestiaSSArrayBlock skipwhite
+
syn keyword celestiaSSLocationCmd LongLat nextgroup=celestiaSSArrayBlock skipwhite
   
syn keyword celestiaSSUniformCmd MeridianAngle nextgroup=celestiaSSNumber skipwhite
+
syn keyword celestiaSSUniformCmd MeridianAngle nextgroup=celestiaSSNumber skipwhite
   
syn keyword celestiaSSMainInnerKw Atmosphere EllipticalOrbit nextgroup=celestiaSSDescBlock
+
syn keyword celestiaSSMainInnerKw Atmosphere EllipticalOrbit nextgroup=celestiaSSDescBlock
syn keyword celestiaSSMainInnerKw UniformRotation nextgroup=celestiaSSDescBlock
+
syn keyword celestiaSSMainInnerKw UniformRotation nextgroup=celestiaSSDescBlock
syn keyword celestiaSSMainKw AltSurface ReferencePoint Location nextgroup=celestiaSSDescString
+
syn keyword celestiaSSMainKw AltSurface ReferencePoint Location nextgroup=celestiaSSDescString
   
syn keyword celestiaSSStdBlockCmd AbsMag AppMag Dec Distance nextgroup=celestiaSSNumber skipwhite
+
syn keyword celestiaSSStdBlockCmd AbsMag AppMag Dec Distance nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSStdBlockCmd Class CustomOrbit SpectralType nextgroup=celestiaSSString skipwhite
+
syn keyword celestiaSSStdBlockCmd Class CustomOrbit SpectralType nextgroup=celestiaSSString skipwhite
syn keyword celestiaSSStdBlockCmd Color HazeColor Orientation nextgroup=celestiaSSArrayBlock skipwhite
+
syn keyword celestiaSSStdBlockCmd Color HazeColor Orientation nextgroup=celestiaSSArrayBlock skipwhite
   
syn keyword celestiaSSStdBlockCmd Emissive nextgroup=celestiaSSBool skipwhite
+
syn keyword celestiaSSStdBlockCmd Emissive nextgroup=celestiaSSBool skipwhite
syn keyword celestiaSSStdBlockCmd HazeDensity Importance nextgroup=celestiaSSNumber skipwhite
+
syn keyword celestiaSSStdBlockCmd HazeDensity Importance nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSStdBlockCmd EquatorAscendingNode Oblateness nextgroup=celestiaSSNumber skipwhite
+
syn keyword celestiaSSStdBlockCmd EquatorAscendingNode Oblateness nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSStdBlockCmd InfoURL nextgroup=celestiaSSUrlStr skipwhite
+
syn keyword celestiaSSStdBlockCmd InfoURL nextgroup=celestiaSSUrlStr skipwhite
syn keyword celestiaSSStdBlockCmd Mesh NightTexture OrbitBarycenter nextgroup=celestiaSSString skipwhite
+
syn keyword celestiaSSStdBlockCmd Mesh NightTexture OrbitBarycenter nextgroup=celestiaSSString skipwhite
syn keyword celestiaSSStdBlockCmd Obliquity PrecessionRate RA nextgroup=celestiaSSNumber skipwhite
+
syn keyword celestiaSSStdBlockCmd Obliquity PrecessionRate RA nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSStdBlockCmd Radius RotationOffset RotationPeriod nextgroup=celestiaSSNumber skipwhite
+
syn keyword celestiaSSStdBlockCmd Radius RotationOffset RotationPeriod nextgroup=celestiaSSNumber skipwhite
syn keyword celestiaSSStdBlockCmd SpectralType Texture Type nextgroup=celestiaSSString skipwhite
+
syn keyword celestiaSSStdBlockCmd SpectralType Texture Type nextgroup=celestiaSSString skipwhite
   
   
Line 147: Line 146:
   
   
hi def link celestiaSSAtmosphCmd Statement
+
hi def link celestiaSSAtmosphCmd Statement
hi def link celestiaSSBool Boolean
+
hi def link celestiaSSBool Boolean
hi def link celestiaSSComment Comment
+
hi def link celestiaSSComment Comment
hi def link celestiaSSDescString PreProc
+
hi def link celestiaSSDescString PreProc
hi def link celestiaSSEllOrbitCmd Statement
+
hi def link celestiaSSEllOrbitCmd Statement
hi def link celestiaSSLocationCmd Statement
+
hi def link celestiaSSLocationCmd Statement
hi def link celestiaSSHIPNumber Type
+
hi def link celestiaSSHIPNumber Type
hi def link celestiaSSMainInnerKw Special
+
hi def link celestiaSSMainInnerKw Special
hi def link celestiaSSMainKw Keyword
+
hi def link celestiaSSMainKw Keyword
hi def link celestiaSSNumber Constant
+
hi def link celestiaSSNumber Constant
hi def link celestiaSSObjectPath PreProc
+
hi def link celestiaSSObjectPath PreProc
hi def link celestiaSSStdBlockCmd Statement
+
hi def link celestiaSSStdBlockCmd Statement
hi def link celestiaSSString Constant
+
hi def link celestiaSSString Constant
hi def link celestiaSSTodo Todo
+
hi def link celestiaSSTodo Todo
hi def link celestiaSSUrlStr Underlined
+
hi def link celestiaSSUrlStr Underlined
 
</pre>
 
</pre>

Latest revision as of 19:30, May 1, 2008

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