Is there a way to increment numbers when using multiple cursors in Atom?

Atom Editor

Atom Editor Problem Overview


Animated GIF showing input being typed into an editor. The letter 'a' is on six separate lines. The lines are all selected. The text

I find myself doing this over and over again. It can be pretty time consuming. What options are available for this?

Atom Editor Solutions


Solution 1 - Atom Editor

The Increment Selection package might be what you're looking for. It seems to be working with multiple cursors, so should be pretty close to your use case:

> Select a block of text and hit ctrl-shift-i to replace it with incrementing numbers > > * Uses first line's number if any > * Works with multiple cursors

Increment Selection Demo

Solution 2 - Atom Editor

There are a few others available now too. Increment Selection hasn't been touched in 2 years.

Newest and most robust seems to be: https://atom.io/packages/multi-cursor-increment

It can set things to incremental numbers and even move everything up or down by 1 afterwards.

Another option: https://atom.io/packages/increment-me

Solution 3 - Atom Editor

or you may try emmet

{item$$, }*3 will transform to item01, item02, item03,

P.S. I am using atom.io, didn't know if it works on sublime-text or other editor.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDaniel says Reinstate MonicaView Question on Stackoverflow
Solution 1 - Atom EditornwinklerView Answer on Stackoverflow
Solution 2 - Atom EditorsirclesamView Answer on Stackoverflow
Solution 3 - Atom EditorCyrus NganView Answer on Stackoverflow