【问题标题】:Prevent Duplicate UltiSnips Matching防止重复的 UltiSnips 匹配
【发布时间】:2014-07-20 03:42:27
【问题描述】:

我定义了两个 UltiSnips 触发器,它们以我想要阻止的一种特定方式匹配。第一个触发器定义如下:

snippet "exa(ct)?" "Exact" r

第二个是这样的:

snippet "getct|ct" "Get( CurrentTime )" rw

键入 exact<tab> 会给我 UltiSnips 的选择消息,让我选择上述选项之一。除非它被非单词字符包围,否则第二个 sn-p 末尾的 w 选项不应该阻止它触发吗?

【问题讨论】:

    标签: vim ultisnips


    【解决方案1】:

    解决方案是在正则表达式的开头使用\b 并放弃w 选项,因为r 总是覆盖其他选项。

    snippet "\bexa(ct)?" "Exact" r
    ...
    snippet "\bgetct|ct" "Get( CurrentTime )" r
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-06
      • 1970-01-01
      • 2011-01-14
      • 2012-07-14
      相关资源
      最近更新 更多