Code folding works well for functions, but I’d like to know if I can manually set a start/end markers to fold a region inside my text?
Example:
-- FoldBegin text1 text2 text3 ... textn -- FoldEnd
Code folding works well for functions, but I’d like to know if I can manually set a start/end markers to fold a region inside my text?
Example:
-- FoldBegin text1 text2 text3 ... textn -- FoldEnd
Note: This plugin does not create folding markers (the functionality for creating these markers is not exposed within the Sublime Text API). The folding functionality provided by this plugin relies on using keyboard shortcuts assigned by the User or by invoking fold commands through the command panel.
Yes I noticed that. But it allows you to creat custom fold region indicators. That you can then fold at. It would be expanded to use phantoms as code fold buttons.
I installed this package, I read all the instructions but I didn’t find anything explaining how to “creat custom fold region indicators”…
Could you tell me how?
You can fold any region by selecting it and pressing Ctrl + Shift + [
.
On Windows the key [
is not necessarily the key you press if you don’t have an English keyboard, then it’s the key where [
would be on an English keyboard, or the second key from right on the first line of characters.
I think you didn’t understand the original question. I want to have fixed markers in the text to delimit regions to fold.
I don’t want to manually select the same region every time and fold it manually.
The native Sublime Text folding already fold automatically functions and other things.
But there are some areas that are not folded.
So there I want to put some delimiters/markers which would indicate the folding region, exactly as done with functions.
I think I found a solution (that was all the time under my nose) at least for my case, editing .lua files:
To make a foldable region:
From there, just position the mouse at the beginning of the first comment line and you will see an option to fold the block. Or use the fold keyboard shortcuts, for example, Ctrl+K,Ctrl+1 to fold all: