I use Sublime text 2 as my IDE at both work and home. On a windows machine sublime remembers all the folders in the left had column when the programme is closed ect.
However on my mac using sublime removes the folders as soon as that window is closed.
Does anyone know how to fix this?
This option should be under Sublime Text 2 -> Preferences -> Settings – Default
// Exiting the application with hot_exit enabled will cause it to close
// immediately without prompting. Unsaved modifications and open files will
// be preserved and restored when next starting.
//
// Closing a window with an associated project will also close the window
// without prompting, preserving unsaved changes in the workspace file
// alongside the project.
"hot_exit": false,
// remember_open_files makes the application start up with the last set of
// open files. Changing this to false will have no effect if hot_exit is
// true
"remember_open_files": false,
Related
I have an extension which initiates downloads in its background page. The current problem is when you call chrome.downloads.download for, say 100 times, it will download 5 files at a time until all 100 files have been downloaded.
I had same problem with images and I found some answer which works for me:
Press "Windows-R" to open the Run tool. Type "regedit" into the box, click "OK" and then, if prompted, confirm the operation or type your administrator password to open the Registry Editor.
Double-click the "HKEY_CURRENT_USER" directory in the left pane. Double-click the "Software" sub-directory, double-click "Microsoft," double-click "Windows," double-click "CurrentVersion" and then single-click "Internet Settings."
Open the "Edit" menu, move your mouse cursor over "New" and then click "DWORD (32-bit) Value" to create a new registry entry. Name the entry "MaxConnectionsPerServer" (omit the quotes) and double-click it to view its properties.
Select the "Decimal" option from the "Base" section of the "Edit DWORD (32-bit) Value" dialog that opens up. Type the number of simultaneous downloads you want into the "Value Data" box, such as "10" (again, omit the quotes) and click "OK."
Repeat the previous two steps with only one change: This time name the new registry entry "MaxConnectionsPer1_0Server". Close the Registry Editor, close any open programs and restart your computer. The simultaneous download limit change will now go into effect.
For effect I added 650 connections or downloads and it worked for me downloaded 650 pictures from some html file with this code:
var a = document.getElementsByTagName('a');
for(var i=0; i<a.length; i++){
var myimg = a[i].getElementsByTagName('img')[0].src;
a[i].href = myimg;
a[i].download = myimg;
a[i].click();
}
HERE IS THE ANSWER... I almost gave up then I stumbled upon it. Settings >> Advanced >> Downloads >> Unclick "ask where to save each file before downloading". Done! Now you can have virtually unlimited concurrent downloads (given your also using a download manager addon or other). This was on a Mac - no idea how it is handled on Windows.
Unfortunately you can't control that. It's a limitation of chrome's browser. It would be a security issue if you can flood the user's browser with an unlimited number of downloads.
I often will have a scratch pad in ST that I then close via Ctrl-F4. It always prompts me to save it, which I find to be a pain.
Is there a setting in ST where I can either change to default of this dialog to "Close without saving", or do not even prompt me at all if it is a new file (i.e. has no name).
You can set a tab to be a scratch buffer (doesn't prompt to save when closed). With the desired tab opened, open the console with Ctrl` and type:
view.set_scratch(True)
then hit Enter, and close the console with Esc. You can now close the tab whenever you want without being prompted. Of course, you can manually save the contents if you wish.
If you would like to have all new buffers set to scratch by default, you'll need a plugin. Create a new Python file in Sublime with the following contents:
import sublime
import sublime_plugin
class SetNewScratchBuffer(sublime_plugin.EventListener):
def on_new(self, view):
view.set_scratch(True)
def on_save(self, view):
view.set_scratch(False)
Save the file as Packages/User/set_new_scratch_buffer.py where Packages is the folder opened when selecting Preferences -> Browse Packages... (~/.config/sublime-text-2/Packages on Linux with ST2). Once saved, it should automatically become active, although you can restart Sublime to make sure. Now, all new buffers created with CtrlN or File -> New File will automatically have the scratch attribute set. This will be disabled when the file is saved, so you don't accidentally destroy changes to an opened file.
When I perform these steps:
Open an existing file in Sublime Text 2.
Type in arbitrary text at an arbitrary place in the file.
Close Sublime Text 2.
Note, I have not saved the changes.
Open Sublime Text 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?
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)
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.
I have the issue after updating Sublime Text 2 (old version) to Sublime Text (new version) on macOS. I don't know why the old version has the suffix "2".
Anyway, a solution to restore the whole my previous session is to copy a file Session.sublime_session, before the manipulation close the Sublime Text app, then execute a command:
cp ~/Library/Application\ Support/Sublime\ Text\ 2/Settings/Session.sublime_session ~/Library/Application\ Support/Sublime\ Text/Local/Session.sublime_session
And finally, start the Sublime Text app.
There have been too many times where I have accidentally clicked the X on the top right window in Sublime Text 2. I then loose my undo/redo history.
Edit: I have tried to set hot_exit to false in default and user settings.
Look for hot_exit in Preferences.sublime-settings
// Exiting the application with hot_exit enabled will cause it to close
// immediately without prompting. Unsaved modifications and open files will
// be preserved and restored when next starting.
//
// Closing a window with an associated project will also close the window
// without prompting, preserving unsaved changes in the workspace file
// alongside the project.
"hot_exit": true,
and set it to false.
Install the plugin Local History.
Every time you modify a file, a copy of the old contents is kept in
the local history.
Either do it through Package Control (If you don't have it already, install it)
Or get it on Github
I am on Lion - and in the command line, when I open up my project using "subl ." in my project folder - it opens up the last project I had open before I quit Sublime.
I have the Max Preference "Restore windows when quitting" unchecked.
How to I prevent this behaviour? Is there a preference setting for this?
I think the behavior you want can be enabled by changing the hot_exit and remember_open_files settings. If you check out the "Global Settings - Default" preferences, there are some comments there describing these settings.
If you want to change them, you should override them in the "Global Settings - User" file to preserve your changes across updates.
If anyone is wondering how to do this in sublime text 3, copy and paste the following into settings - user:
"hot_exit": false,
"remember_open_files": false,
I could only get it to work by also setting "hot_exit": false in my preferences.
On Linux, I had an issue where I couldn't even start Sublime Text 3 because there were too many files open and it would hang before I got a chance to change the settings.
I did what Mike Wizowski suggested and edited my $HOME/.config/sublime-text-3/Packages/User/Preferences.sublime-settings to include those settings.
However, restarting Sublime Text after this did not seem to fix my problem because Sublime still opened all the files and folders.
I found that deleting the 2 ".sublime_session" files in $HOME/.config/sublime-text-3/Local/ made Sublime Text forget what the recently opened files/folders were, thus fixing my hanging text editor.