Sublime Forum

Comma limit and indentaion

#1

If we have
a,b,c,d,e,f,g,h,i,j
then can this be indented as:

a,
b,
c,
d,
e,
f,
g

wrap is a different thing.

0 Likes

#2

Hi
I’m not sure what you’re asking ? Do you want to automate turning

into

for example ?

Need a little more information please…

:unicorn: :skull_and_crossbones:

1 Like

#3

Maybe not automation, but on click of few buttons such as:

CTRL+Click Something

0 Likes

#4

The way I’d do this is select the first comma, use ctrl+d to select the others, then press right to put all the selections to the right of each comma and press enter.

7 Likes

#5

I know that, but doing that to 50 or more than 50 entries won’t be an easy exercise.

0 Likes

#6

Holding down a key isn’t easy? You’ve also got alt+f3 to select all the commas in a file if you have too many of them.

1 Like

#7

Intitally there are no commas we have to infuse in them.

0 Likes

#8

I dont get it.

1 Like

#9

ALT+F3 Logic is clear now. Thanks.

0 Likes

#10

Also using ctrl+h and a regex search (which I haven’t mastered at all, but know it can be done) search for any lower case letter [maybe a-i] [in a selection] and insert comma+newline ?

:unicorn: :skull_and_crossbones:

ps there’s an endcase senario, depends whethers there’s already a newline after the j. I’m sure finer minds than mine will correct my logic.
pps Fair play for generating quite a lot of input from very little output ! :wink:

1 Like

#11

Coincidentally I was learning regular expression yesterday:

0 Likes