Sublime Forum

How do you change the folding behavior or style?

#1

Is there a way to change the folding style to mimic visual studio:
Imgur
Where both braces are on the same line? Thank you.

2 Likes

#2

It is possible to include newlines in the folded region and to do so with the API, but the folding behavior when clicking on the folding arrows is not configurable.

0 Likes

#3

you can also change the default image by editing the theme (IIRC) at least the image is there

0 Likes

#4

Thank you for your reply. Also, I’m sorry I must have missed the response. I checked back and I guess I didn’t notice your reply. My apologies

Please help me understand what you’re saying. That I can not make sublime put the folded region to the right of the line? I don’t need the square box or the braces visible, if that’s what you were thinking.

0 Likes

#5

tito, which image are you referring to?

0 Likes

#6

The yellow ellipsis image:

@FichteFoll is referring to the fact that in Sublime you can fold any text region you like. Just select any range of text and hit Edit > Code Folding > Fold (or the shortcut for your system). What the folding arrows in the gutter do is baked in and non-configurable, but Sublime can fold any way you like.

3 Likes

#7

Ahh, ok, I’m not worried about the folding arrows in the gutter. I am definitely interested in what the ellisis do and where they go.

For example, the bracing style in the current project I’m on uses the Allman style.

Now I didn’t know I could simple select and fold (Very cool btw) but now that I know this I was able to fold it .Which is precisely what I am trying to achieve when I go: Edit > Code folding > Fold all [ctrl + k, ctrl + 1]

Where can I change the “Fold All” behavior? Is there a script I can write to achieve this?

0 Likes