Where does Sublime Text 2 store editing informatio

2019-04-18 05:04发布

When I perform these steps:

  1. Open an existing file in Sublime Text 2.
  2. Type in arbitrary text at an arbitrary place in the file.
  3. Close Sublime Text 2.

Note, I have not saved the changes.

  1. Open Sublime Text 2.
  2. Open the file from step 1.

I see changes in the file. But if I view the file in, let's say, Notepad, I see no changes.

Where does Sublime Text 2 keep the changes made to files?

2条回答
来,给爷笑一个
2楼-- · 2019-04-18 05:29

If you have made a project, the magical file-restore fairy will be in the folder where you told Sublime to store your project, in a file called [yourprojectname].sublime-workspace.

If you delete that workspace file before opening, Sublime will nuke your changes and complain about opening any previously open files. This move will probably cause you some grief, so don't try it unless you've already saved all necessary changes.

The workspace saves, among other things, your window layout, all the contents of any files that are open, and your last find/replace/autocomplete entries. (That is why your autocomplete gets "smarter" over time).

Note the little symbol where there is normally an x to close the tab. If it is a dot instead of an x, the file is considered unsaved and will be brought back also unsaved when you re-open Sublime.

查看更多
\"骚年 ilove
3楼-- · 2019-04-18 05:32

As far as I'm concerned the question isn't answered completely...

As nnnn explained, the unsaved changes of a project are saved in its sublime-workspace file.

But if you haven't created a project and you are just working on some files, sublime also does remember the unsaved changes. These were saved in 'Session.sublime_session'.

Where the session can be found, depends on your operating system:

  • OS X: ~/Library/Application Support/Sublime Text 2/Settings/
  • Windows: %APPDATA%\Sublime Text 2\Settings\
  • Linux: ~/.config/sublime-text-2/Settings/

(I just found this info some kind of accidentally in the official sublime forum)

查看更多
登录 后发表回答