Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有时我需要在一个片段中多次使用一个变量。例如,当我需要设置一个键值列表时:
${1}_key: ${1}_value
${1}在这种情况下,我希望当我触发 snipmate 时,光标可以首先停止。foo当我第一次输入类似的东西时${1},它可以变成
${1}
foo
foo_key: foo_value
因此,我只需要输入foo一次。我怎样才能做到这一点?
这很简单:
${1:}_key: $1_value