Sublime Forum

Align indent on paranthesis on linebreak

#1

I posted this question on stackoverflow and got the recommendation to ask here as well.
stackoverflow.com/questions/1238 … ime-text-2

Reposted here:
I like to keep my lines below 80 columns, so I often want to refactor a line that looks like this:

object.function(a_long_argument, another_long_argument, and_a_third)

to this:

object.function(a_long_argument, another_long_argument, and_a_third)
But when I press Enter after the first “,” in Sublime it just linebreaks and indents the cursor a few spaces. I want it to align to the paranthesis or ] or {} that I am in, like Emacs does so beautifully.

Is there an option for this? Is there a plugin for this? Do I have to write my own?

I have tried searching for it, but I have not found anything.

0 Likes

#2

You may have to write your own…
If you’re excited about crazy awesome plugins, though, I recommend this one:
github.com/SublimeText/ElasticTabstops
May take a little while to get used to? But it lets you do fancy indenting real easily.

0 Likes

#3

It is a crime against all that is holy to indent with tabs. Also it violates PEP-8. Also it would make it impossible to do detail alignment, like the one I ask for with the paranthesis.

0 Likes