简体   繁体   English

Vim的snipMate多个触发器用于同一片段

[英]Vim's snipMate multiple triggers for the same snippet

is it possible to specify more than one trigger for the exact same snippet? 是否可以为完全相同的代码段指定多个触发器?
Working with Fortran I would like to trigger an IF THEN END IF snippet with both if and IF trigger. 使用Fortran,我想同时使用ifIF触发器来触发IF THEN END IF片段。
As a small solution I am now repeating the snippet multiple time, like this: 作为一个小解决方案,我现在多次重复代码段,如下所示:

snippet wr
    WRITE(*,*) 
snippet WR
    WRITE(*,*) 
snippet re
    READ(*,*) 
snippet RE
    READ(*,*) 
snippet if
    IF (${1}) THEN
        ${2}
    END IF
snippet IF
    IF (${1}) THEN
        ${2}
    END IF
snippet select
    SELECT CASE (${1})
        CASE (${2})
            ${3}
    END SELECT
snippet SELECT
    SELECT CASE (${1})
        CASE (${2})
            ${3}
    END SELECT

Is there a better solution? 有更好的解决方案吗?

Using multi_snip. 使用multi_snip。 Give third parameter as description on your snippet. 在您的代码段中输入第三个参数作为说明。 Example: 例:

snippet wr A description of snippet #wr
  write something
snippet wr A description of snippet #wr other
  write something else

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM