vim语法高亮问题

原文

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' contained extend

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

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

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

posted @   zjh6  阅读(17)  评论(0编辑  收藏  举报  
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示