I currently have a syntax file that parses a log file very similar to the following [this is for syslog]:
syn match syslogText /.*$/
syn match syslogFacility /.\{-1,}:/ nextgroup=syslogText skipwhite
syn match syslogHost /\S\+/ nextgroup=syslogFacility,syslogText skipwhite
syn match syslogDate /^.\{-}\d\d:\d\d:\d\d/ nextgroup=syslogHost skipwhite
Using a map, I would like to switch whether a given group is hidden (say, syslogHost) or not. Is there a way to do something like the following pseudocode:
map <leader>ch :syn match syslogHost conceal!
and thereby switch the definition of syslogHost between:
syn match syslogHost /\S\+/ nextgroup=syslogFacility,syslogText skipwhite
and
syn match syslogHost /\S\+/ nextgroup=syslogFacility,syslogText skipwhite conceal
Thank.
source
share