Pedro Reis has already replied that Sublime Text 2
does not store the compressed portions of text (this is called folding ) between sessions and that this can be done using plugins. Particularly I do not like to save the session of use and simply disable this feature. So, note that I do not use the plugins I'm going to suggest, okay? I know them "by name" (they were here in my bookmarks, for who knows someday to use in some need ...). If you can successfully use it, please tell us here (in a comment or in your own reply) for future reference. :)
The first plugin is called RegReplace
. It is a tool for creating text matching rules (that is, it does a "search" and performs an "action" on the found text). With this tool you can, for example, create a content search between <div>
and <\div>
clauses and use an override action (see as in Project Readme) of type fold
to compress the text block found. Plugins are initialized a few seconds after the editor, so it might be easy to run your rule automatically at the beginning (honestly, I'm not sure).
This one, called BufferScroll
, seems more appropriate for what you want and simpler to use because it records different usage settings such as the text scroll position, bookmarks, and also foldings.