background:
I want to highlight columns in a table differently (database output)
So 1 and 2 will be substituted by either \t or |.

============= syntax file ======================================================
hi def link Color1 Macro
hi def link Color2 Error

"Show colors of Color1, Color2
syn keyword Color1 A
syn keyword Color2 B

syn match Color1 '^1\zs[^1]*\ze'
syn match Color2 '^1[^1]*1\zs[^1]*\ze'
syn match Color2 '^2[^2]*2\zs[^2]*\ze'

============= testfile =========================================================
A 
B 
1aa1bb    
2cc2dd    

explanation lines testfile:
Line 1 testline to show Color1
Line 2 testfile to show Color2
Line 3 Here aa and bb should be highlighted with Color1, Color2 ( bb isn't)
Line 4 only dd should be highlighted to show that the match pattern
works (only difference is 2 instead of 1)

Marc

Reply via email to