home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / share / vim / syntax / css.vim < prev    next >
Encoding:
Text File  |  1999-08-10  |  5.4 KB  |  123 lines

  1. " Vim syntax file
  2. " Language:    Cascading Style Sheets
  3. " Maintainer:    Claudio Fleiner <claudio@fleiner.com>
  4. " URL:        http://www.fleiner.com/vim/syntax/css.vim
  5. " Last change:    1998 Jun 16
  6.  
  7. " Remove any old syntax stuff hanging around
  8. syn clear
  9. syn case ignore
  10.  
  11. if !exists("main_syntax")
  12.   let main_syntax = 'css'
  13. endif
  14.  
  15. syn keyword cssTagName address applet area a base basefont
  16. syn keyword cssTagName big blockquote body br b caption center
  17. syn keyword cssTagName cite code dd dfn dir div dl dt em font
  18. syn keyword cssTagName form h1 h2 h3 h4 h5 h6 head hr html img
  19. syn keyword cssTagName input isindex i kbd link li link map menu
  20. syn keyword cssTagName meta ol option param pre p samp 
  21. syn keyword cssTagName select small span strike strong style sub sup
  22. syn keyword cssTagName table td textarea th title tr tt ul u var
  23.  
  24. syn match cssIdentifier "#[a-zA-Z][a-zA-Z0-9-]*"
  25.  
  26. syn match cssLength contained "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\)\="
  27. syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow 
  28. syn match cssColor contained "white"
  29. syn match cssColor contained "\(#[0-9A-Fa-f]\{3\}\>\|#[0-9A-Fa-f]\{6\}\>\|rgb\s*(\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*)\)"
  30. syn match cssURL contained "\<url\s*([^)]*)"ms=s+4,me=e-1
  31.  
  32. syn match cssImportant contained "!\s*important\>"
  33.  
  34. syn match cssFontProperties contained "\<font\>\(-\(family\|style\|variant\|weight\|size\)\)\="
  35. syn keyword cssFontProperties contained xyz
  36. syn keyword cssFontAttr contained cursive fantasy monospace normal italic oblique
  37. syn keyword cssFontAttr contained bold bolder lighter medium larger smaller
  38. syn match cssFontAttr contained "\<\(sans\>-\)\=\<serif\>"
  39. syn match cssFontAttr contained "\<small-caps\>"
  40. syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(\<small\>\|\<large\>\)\>"
  41.  
  42. syn match cssColorProperties contained "\<color\>"
  43. syn match cssColorProperties contained "\<background\>\(-\(color\|image\|repeat\|attachment\|position\)\>\)\="
  44. syn keyword cssColorAttr contained transparent none top center bottom left right scroll fixed
  45. syn match cssColorAttr contained "\<\(repeat\|repeat-x\|repeat-y\|no-repeat\)\>"
  46.  
  47.  
  48. syn match cssTextProperties contained "\<\(word-spacing\|letter-spacing\|text-decoration\|vertical-align\|text-transform\|text-align\|text-indent\|line-height\)\>"
  49. syn keyword cssTextAttr contained normal none underline overline blink sub super middle
  50. syn keyword cssTextAttr contained capitalize uppercase lowercase none left right center justify
  51. syn match cssTextAttr contained "\<line-through\>"
  52. syn match cssTextAttr contained "\<\(text-\)\=\<\(top\|bottom\)\>" 
  53.  
  54. syn match cssBoxProperties contained "\<margin\>\(-\(top\|right\|bottom\|left\)\>\)\="
  55. syn match cssBoxProperties contained "\<padding\>\(-\(top\|right\|bottom\|left\)\>\)\="
  56. syn match cssBoxProperties contained "\<border\>\(-\(top\|right\|bottom\|left\)\>\)\=\(-width\>\)\="
  57. syn match cssBoxProperties contained "\<border-color\>"
  58. syn match cssBoxProperties contained "\<border-style\>"
  59. syn keyword cssBoxProperties contained width height float clear
  60. syn keyword cssBoxAttr contained auto thin medium thick left right none both
  61. syn keyword cssBoxAttr contained none dotted dashed solid double groove ridge inset outset
  62.  
  63. syn keyword cssClassificationProperties contained display 
  64. syn match cssClassificationProperties contained "\<white-space\>"
  65. syn match cssClassificationProperties contained "\<list-\(item\|style\(-\(type\|image\|position\)\)\=\)\>"
  66. syn keyword cssClassificationAttr contained block inline none normal pre nowrap
  67. syn keyword cssClassificationAttr contained disc circle square decimal none
  68. syn match cssClassificationAttr contained "\<list-item\>"
  69. syn match cssClassificationAttr contained "\<\(lower\|upper\)-\(roman\|alpha\)\>"
  70.  
  71. syn region cssInclude start="@import" start="@include" end=";" contains=cssComment,cssURL
  72. syn match cssBraces contained "[{}]"
  73. syn match cssError contained "{@<>"
  74. syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Properties,cssComment,cssLength,cssColor,cssURL,cssImportant,cssError,cssString
  75.  
  76. syn match cssPseudoClass transparent ":\S*" contains=cssPseudoClassId
  77. syn keyword cssPseudoClassId contained link visited active
  78. syn match cssPseudoClassId contained "\<first-\(line\|letter\)\>"
  79.  
  80. syn region cssComment start="/\*" end="\*/"
  81. syn match cssComment "//.*$"
  82.  
  83. syn region cssString start=+"+ skip=+\\\\\|\\"+ end=+"+
  84. syn region cssString start=+'+ skip=+\\\\\|\\'+ end=+'+
  85.  
  86. if main_syntax == "css"
  87.   syn sync minlines=10
  88. endif
  89.  
  90. if !exists("did_css_syntax_inits")
  91.   hi link cssComment Comment
  92.   hi link cssTagName Statement
  93.   hi link cssFontProperties StorageClass
  94.   hi link cssColorProperties StorageClass
  95.   hi link cssTextProperties StorageClass
  96.   hi link cssBoxProperties StorageClass
  97.   hi link cssClassificationProperties StorageClass
  98.   hi link cssFontAttr Type
  99.   hi link cssColorAttr Type
  100.   hi link cssTextAttr Type
  101.   hi link cssBoxAttr Type
  102.   hi link cssClassificationAttr Type
  103.   hi link cssPseudoClassId PreProc
  104.   hi link cssLength Number
  105.   hi link cssColor Constant
  106.   hi link cssURL String
  107.   hi link cssIdentifier Function
  108.   hi link cssInclude Include
  109.   hi link cssImportant Special
  110.   hi link cssBraces Function
  111.   hi link cssError Error
  112.   hi link cssInclude Include
  113.   hi link cssString String
  114. endif
  115.  
  116. let b:current_syntax = "css"
  117.  
  118. if main_syntax == 'css'
  119.   unlet main_syntax
  120. endif
  121.  
  122. " vim: ts=8
  123.