WebStorm JavaScript实时模板 - 决定光标的位置 [英] WebStorm JavaScript live template - deciding where the cursor will be
本文介绍了WebStorm JavaScript实时模板 - 决定光标的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个JavaScript实时模板,我在WebStorm中大量使用:
I've created a JavaScript live template which I use a lot in WebStorm:
console.log('$PARAM$ -> ', $PARAM$);
它可以让我更快地输入这种线条:
It helps me type this kind of lines faster:
console.log('nextProps -> ', nextProps);
然而,因为它从第一个 $ PARAM $ $ c $开始c>我没有获得自动完成功能。有没有办法让光标到第二个
$ PARAM $
,同时保持重复文本的添加?
However as it starts on the first $PARAM$
I don't get autocomplete. Is there a way to get the cursor to the second $PARAM$
while keeping the duplicated text adding?
推荐答案
- 使用2个变量而不是1个
- 重新排序 - 第二个应该先填充
- 告诉IDE自动将第二个变量复制到第一个
- 告诉IDE忽略第一个变量(如果它有#3)
- Use 2 variables instead of 1
- Reorder them -- 2nd one should be filled first
- Tell IDE to auto-copy 2nd variable into 1st
- Tell IDE to ignore 1st variable if it has value (which it will because of #3)
console.log('$PARAM1$ -> ', $PARAM2$);
这篇关于WebStorm JavaScript实时模板 - 决定光标的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文