Home Download Buy Blog Forum Support

Align indent on paranthesis on linebreak

Align indent on paranthesis on linebreak

Postby gurgeh on Thu Sep 13, 2012 9:00 am

I posted this question on stackoverflow and got the recommendation to ask here as well.
http://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:

Code: Select all
object.function(a_long_argument, another_long_argument, and_a_third)

to this:

Code: Select all
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.
gurgeh
 
Posts: 2
Joined: Thu Sep 13, 2012 8:56 am

Re: Align indent on paranthesis on linebreak

Postby adzenith on Thu Sep 13, 2012 6:36 pm

You may have to write your own...
If you're excited about crazy awesome plugins, though, I recommend this one:
https://github.com/SublimeText/ElasticTabstops
May take a little while to get used to? But it lets you do fancy indenting real easily.
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: Align indent on paranthesis on linebreak

Postby gurgeh on Fri Sep 14, 2012 9:22 am

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.
gurgeh
 
Posts: 2
Joined: Thu Sep 13, 2012 8:56 am


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot] and 13 guests