如何在 jetbrains IDE(IntelliJ IDEA) 中通过多光标插入带有单词的递增数字?

How To Insert Incrementing Numbers with words by Multicursor in jetbrains IDE(IntelliJ IDEA)?

我想在 jetbrains 中通过 Multicursor 添加带有单词的递增数字 IDE(IntelliJ IDEA) .

有什么方法可以通过Live模板实现吗?我想做这样的事情 :

您可以使用 String Manipulation plugin 来做到这一点(Increment/Decrement | Increment duplicatesCreate sequence)。

该插件无法在我的 WebStorm 上运行,可能有另一种使用 unix 命令行的方法:

seq 1 10 | xargs printf 'string%d\n'

你实际上可以在没有插件的情况下做到这一点。

  1. select 使用您首选方法的号码列表
  2. 复制
  3. select 目标位置
  4. 粘贴

我select原来的号码是:

  • select评分词
  • ctrl+G(多行selection)
  • 将光标放在 e 和第一个数字之前(只需按向右箭头)
  • shift+option+ >(向右箭头)。在 selecting
  • 时移动到单词的末尾

其他选项是带有 shift+option+cmd+paint 的多光标 selection (macos)

目标相同。