kstenschke / shifter-plugin

Intelligent string/code manipulation plugin for Jetbrains IDEs: Detects shiftable type of word/line/selection and manipulates it on keyboard shortcut
http://plugins.jetbrains.com/plugin/6149
Apache License 2.0
105 stars 13 forks source link

feat(multi-selection): add support for multi-lines shifting #14

Closed edouard-lopez closed 8 years ago

edouard-lopez commented 9 years ago

Since the addition of Multiple Selections in PyCharm it wourd be nice to be able to select several occurences and increment them in a batch. Some behaviors must be discussed:

kstenschke commented 9 years ago

Hi Eduard, thanks for opening this discussion with an interesting idea!

The suggested first strategy of in/decrementation (1, 4, 5, 62, 5, 6, 7) seems the most obvious approach to me, matching the current implementation of shifter.

Can you describe a recurring scenario when the second strategy is helpful? What other strategies can you think of?

iby commented 9 years ago

:+1: Yes, please!!!

krasa commented 9 years ago

Another case:

Comment a1 = new Comment(1,null);
Comment a1 = new Comment(1,null);
Comment a1 = new Comment(1,null);

into:

Comment a1 = new Comment(1,null);
Comment a2 = new Comment(1,null);
Comment a3 = new Comment(1,null);

http://stackoverflow.com/q/30156282/685796

kstenschke commented 9 years ago

Thank you Vojtêch for the suggestion and link to stackoverflow. :+1: Currently shifter sorts multi-line selections alphabetically when shifting them, i think having it detect and enumerate a multi-line selection of identical lines into a sequence might be a cool additional feature.

AbcAeffchen commented 9 years ago

:+1: I would love to see the feature suggested by Vojtěch.

krasa commented 8 years ago

I needed bunch of unique variable names the other day, and it pissed me off doing it one by one, so I implemented it :)

kstenschke commented 8 years ago

wow, sounds cool. looking forward to your pull request :)

krasa commented 8 years ago

There won't be any :-) But feel free to copy paste it from my plugin.