Sublime Forum

Code Folding and Selection

#1

Is there a way, when code folding based on ST2’s default indentation method, to select a folded section rather than just the head line of the section?

I’m looking to be able to “fold all”, then be able to select whole sections by their head lines then cut/paste them about, quickly and easily.

Thanks,
Kensai

0 Likes

#2

The head line of the selection will only be selected if you use a shortcut that operates on lines like shift+end or ctrl+l: if you select the fold marker using the mouse, or shift+arrow keys, the entire folded text will be selected.

0 Likes

#3

Okay, shift+end helped me out there, thanks. Just wasn’t getting the fold marker for some reason.

Cut/Paste works fine. I don’t suppose there’s any way to change ST2’s behavior to let ctrl+shift+up/down to function as expected, i.e. move the selected head line + folded section up and down among the other folded head lines and their attached folded sections without them passing through the folded content? Barring that, is there any way to change the paste behavior to where it simply pastes as it was copied, i.e. folded, rather than unfolded with caret at the end of the pasted selection?

0 Likes