简体   繁体   中英

Recover unsaved file from sublime Text 3 window 8

I accidentally closed the unsaved tab in Sublime Text3 and have lost my file, wanted to know if there is any way to recover it? As suggested in many post tried finding in "AppData\Roaming\Sublime Text 3\Local\Session.sublime_session". Don't how it can recover the files

Here is how you can do this with *ix operating systems, including Windows Subsystem for Linux. Using Windows GUI is similar but more complicated to explain in a reproducible manner.

If you've closed the tab, it will probably not be in Session.sublime_session (try it still). It would rather be in Backup Auto Save Session.sublime_session if you try to recover it immediately. On Linux it is in Sublime's Local in.config, eg under ~/.config/sublime-text-3/Local .

In that file you could try looking for part of the text you've had, eg with cat ~/.config/sublime-text-3/Local/Backup\ Auto\ Save\ Session.sublime_session | grep "The text I remember" cat ~/.config/sublime-text-3/Local/Backup\ Auto\ Save\ Session.sublime_session | grep "The text I remember" . If you're lucky, you would find a \n -separated document.

If you want this expanded, you can do this with awk , eg cat ~/.config/sublime-text-3/Local/Backup\ Auto\ Save\ Session.sublime_session | grep "The text I remember" | awk '{gsub("\\\\n","\n")};1' cat ~/.config/sublime-text-3/Local/Backup\ Auto\ Save\ Session.sublime_session | grep "The text I remember" | awk '{gsub("\\\\n","\n")};1' cat ~/.config/sublime-text-3/Local/Backup\ Auto\ Save\ Session.sublime_session | grep "The text I remember" | awk '{gsub("\\\\n","\n")};1' .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM