64

I want to add Incrementing Numbers with words by Multicursor in jetbrains IDE(IntelliJ IDEA) .

Is there any way to do it by Live template? I want to do things like this image :

enter image description here

yole
  • 92,896
  • 20
  • 260
  • 197
Shaiful
  • 928
  • 1
  • 10
  • 11
  • There is no such feature in IntelliJ IDEA out of the box that could do something like that. – yole Dec 14 '16 at 09:18
  • 2
    @yole How about making that an answer? Even if "not possible" is probably not the answer the OP hoped for ;-) (BTW I would find that feature useful myself, every now and then.) – eekboom Dec 14 '16 at 12:32
  • 2
    Not possible out of the box != not possible. – Meo Dec 14 '16 at 21:27

3 Answers3

103

You could use String Manipulation plugin to do that (Increment/Decrement | Increment duplicates or Create sequence).

Meo
  • 12,020
  • 7
  • 45
  • 52
11

The plugin is not working on my WebStorm, there could be another way using unix command line:

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

igonejack
  • 2,366
  • 20
  • 29
1

You can actually do that without plugins.

  1. select a list of numbers with your preferred method
  2. copy
  3. select target positions
  4. paste

I select the original numbers by:

  • selecting the rate word
  • ctrl+G (for multi line selection)
  • place the cursor right before the e and the first number (just press right arrow)
  • shift+option+ > (right arrow). That moves to the end of the word while selecting

other option is multicursor with shift+option+cmd+paint selection (macos)

Same in the target.

demo

mayid
  • 1,644
  • 15
  • 23