How to save collapsed / folded code in Sublime Tex

2019-03-28 06:40发布

问题:

Is there a way to save/sync collapsed code from session to session in Sublime Text 3, now that the BufferScroll plugin has been removed?

回答1:

Here's the background story (I can't find the link, the author might have deleted it, so I'm paraphrasing). Basically, the author of Package Control requested that, instead of using dates as version numbers (such as 2016.03.18.06.34.41 for the most recent version of BufferScroll), package authors should use semantic versioning similar to how Github suggests. titoBouzout, who is not only the author of BufferScroll, but of many other very popular packages such as SideBarEnhancements, Tag, and SideBarGit, tried converting his style to something like v2016.03.18, but apparently Github thought the version number was too high. Or something. I wish I had the original explanation.

At any rate, he was unable to do that, and got all upset (to put it politely) when informed/told that he would have to move to a versioning scheme that nearly all other software on Package Control uses. Instead, he decided to take his ball and go home. He's keeping his own versioning scheme, and keeping his packages available on Github, but they won't be on Package Control any more.

Users will manually have to open the Command Palette, select Package Control: Add Repository, then enter the Github URL to the repo, such as https://github.com/titoBouzout/BufferScroll (make sure there's no .git on the end). They will need to do this for each and every titoBouzout package they want to use. The advantage of this method over directly git cloneing into the Packages directory is that updates are pushed automatically, just like with Package Control packages.

EDIT Fortunately, even though all issues have been deleted from SideBarEnhancements, I still had the relevant issue (Google cache of page before deletion) open on my work laptop. Here is the author's explanation:

Yes, I had problems to add new packages to the repository because there's a "new"(has some time there) requirement to maintain a version number, and I don't want to maintain versions numbers, because to me a date is enough already. I attempted to automate the version number by adding something without any meaning, just a date, but that broke the complete repository because "large number". So because of this disagreement, I removed all my packages from there. Rules changed, so Im no longer interested to distribute my packages via that channel. However you may decide to add this package manually via the option "Add Repository", this may or may not work, Im not uptodate with the requirements of that to work, and as I say, Im not interested.

UPDATE

So, it appears the author has caved to pressure, or changed his mind, or something, but all his packages are now available again via Package Control, at least for now.



回答2:

You could use Auto​Fold​Code which is package just for that xD. It's available via package control.