NaN
NaN

Reputation: 485

Region code folding for javascript

I was looking for a way to fold my JavaScript code in Atom using something like C# regions:

#region: hey
//some cool code here
#endregion

I couldn't find any package like this. I know that you can press CTRL + Alt + F and fold whatever code is selected. But I want to have named regions.

So the real question is, does anybody know how can I do this in Atom?

Thanks!

Upvotes: 5

Views: 3043

Answers (1)

david_g
david_g

Reputation: 779

I was looking for the same and I found the package custom-folds.

By default, it will fold the code between // <editor-fold> and // </editor-fold> but you can customize it to work as // region and // endregion (notice the space between // and region. The package is in active development so it will soon support #region. See the bug https://github.com/bsegraves/custom-folds/issues/3

Upvotes: 7

Related Questions