在Atom中使用多个游标时,有没有办法增加数字?

时间:2015-08-28 15:58:44

标签: atom-editor

Animated GIF showing input being typed into an editor. The letter 'a' is on six separate lines. The lines are all selected. The text "my repetitive task 1" is typed and appears on all six lines at the same time. The 1 on line 2 is changed to 2, the 1 on line 3 is changed to 3 and so on.

我发现自己一遍又一遍地这样做。这可能非常耗时。有哪些选择?

3 个答案:

答案 0 :(得分:28)

Increment Selection包可能就是你要找的东西。它似乎与多个游标一起使用,因此应该非常接近您的用例:

  

选择一个文本块并点击ctrl-shift-i将其替换为递增数字

     
      
  • 使用第一行的号码(如果有的话)
  •   
  • 使用多个游标
  •   

Increment Selection Demo

答案 1 :(得分:5)

现在也有其他几个可用。 2年内没有触及增量选择。

最新且最强大的似乎是: https://atom.io/packages/multi-cursor-increment

它可以将事物设置为增量数字,甚至可以在之后向上或向下移动所有内容。

另一种选择: https://atom.io/packages/increment-me

答案 2 :(得分:1)

或者您可以尝试emmet

{item$$, }*3将转换为item01, item02, item03,

P.S。我正在使用atom.io,不知道它是否适用于sublime-text或其他编辑器。

相关问题