I did not find a way to make code folds permanent, but I would like to know though
In the meantime, I used the Collapse All option in combination with the bookmarks.
When you open the file, you can right-click on the left margin and choose to collapse all (or CTRL + SHIFT + numpad divide). If you are working on a code block, you can also attach a bookmark by right-clicking in the left field, then from the Bookmarks tab, when you double-click on a bookmark, it expands only this code block and brings you to it.
To open a bookmark at the bottom of the window: Window > Show View > Other > General > Bookmarks
source share