Sublime Forum

Fold by indent level

#1

I have purchased sublime text license.

I need to be able to fold the text based on indentation level.
For now I use following key bindings:

ctrl+Kctrl+J : Unfold all
shift+ctrl+] : Unfold code
shift+ctrl+[ : Fold code

I want to be able to fold based on indentation levels.
So for example, CTL+SHIFT+1 : for first level of fold,
CTL+SHIFT+2: For second level of fold etc.

Also toggle the fodling / unfolding by the same key bindings.

Again, this is very similar to what is in Notepad++ or jEdit.

Thanks!
-DP

0 Likes

#2

There are items in the Edit > Code Folding menu item for folding based on indentation; if you look there you can see what keys are bound to those commands by default.

If you would like to change them, you can use Preferences > Key Bindings and copy the default keys from the left pane into your user bindings on the right, and alter the keys to what you want.

1 Like

#3

OMG and almost works -
I lack the ability for unfold level, but can do with CTL+SHIFT+] for now, and may be just level unfolding may not be really needed!

Thanks Guru!
-DP

0 Likes