​原文​

foo [内容] bar '''
更多
'''更多东西

syntax region specialCommand start='\<foo\s' end='$' skip='&$'
\ keepend contains=tripleQuoted
syntax region tripleQuoted start=+\<bar\s\+\z("""\|'''\)+ms=e+1 end='\ze\z1'

​匹配​​​是绑定至行的,因而​​ms=e+1​​在行后不工作.

syntax region tripleQuoted matchgroup=specialCommand
\ start=+\<bar\s\+\z("""\|'''\)+
\ end='\z1'

这样,来修复.
必须​​​设置​​​匹配组为​​父区域​​​,​​matchgroup=specialCommand​​​出现在​​开始和结束​​​匹配​​模式​​前也很重要,