Commits

Serge A. Zaitsev  committed 9dcf0aa

a better syntax highlighting for vim

  • Participants
  • Parent commits 94759bd

Comments (0)

Files changed (1)

 	finish
 endif
 
-:syn match class "^\s*\w\+.\{-}:" contains=id "nextgroup=class skipwhite skipnl skipempty
-:syn match id "#\w\+" contained
+" match lines until EOL without line continuation
+" start is a first word (tag name)
+:syn region block matchgroup=class start=/^\s*[A-Za-z0-9\._]\+/ 
+	\ matchgroup=eol end=/$/
+	\ contains=linecontinue,numeric,ref,id
 
-hi link id Identifier
-hi link class Type
+" identifers start with hash sign
+:syn match id /#\i\+/ contained
+" linecontinuations: no EOL after comma, colon or empty lines
+:syn match linecontinue /\(,\|\_^\|:\)\s*$/ contained
+" highlight numbers
+:syn match numeric /\<[-+]\?\d\w*\>/ contained
+" highlight references, like @drawable/..., @string/... etc
+:syn match ref /@[A-Za-z0-9/]\+/ contained
 
+hi link id Keyword
+hi link class Function
+hi link numeric Number
+hi link ref String
+hi link block Normal
+