How to prevent Sublime Text 2 from opening that last open file / project when starting up - preference

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.

Related

Prevent opening Visual Studio Code when click Show In Folder in Chrome

I've been googling and fighting this for a half a day already.
When I download something in Google Chrome I want to go to the folder with a file. But when I press 'Show in folder' a Visual Studio Code starts instead of my Thunar. How can I fix this?
Firefox opens folders ok but Chromium, Google-Chrome and Opera kicks of Visual Studio Code.
My system is Linux Mint Tara. I've already tried some things. Like added
[Default Applications]
inode/directory=Thunar.desktop
to /home/[user]/.config/mimeapps.list
Completely removed code.desktop from /usr/share/applications/mimeinfo.cache
Ran xdg-mime default Thunar.desktop inode/directory and the output of xdg-mime query default inode/directory is Thunar.desktop!!!
Even fully removed code.desktop from filesystem. Nothing worked!
Please help, this annoys me so much.
This is caused by MimeType=text/plain;inode/directory; which can be found in /usr/share/applications/code.desktop for what I can find.
What fixed it for me is changing this line to MimeType=text/plain; and removing code.desktop from /usr/share/applications/mimelist.cache
EDIT
A more permanent solution i've found is the following.
add inode/directory=org.gnome.Nautilus.desktop to the ~/.local/share/applications/mimeapps.list file.
After doing this make sure to the inode/directory entry is the same or not present at all in ~/.local/share/applications/mimelist.cache' and /usr/share/applications/mimelist.cache
org.gnome.Nautilus.desktop can be replaced by your preferred file explorer if you don't use Nautilus.
You might need to restart your desktop environment for the changes to apply.
The solution is simpler,
What happens is that the system orders the directory opening preferences.
Just go to the file manager > select a folder > right click > open with another application > select the file manager.
This will update the opening preferences for the directories.
Finally found! it. I had to delete
inode/directory; /usr/share/code/code --new-window %s; test=test -n "$DISPLAY"
line in the /etc/mailcap file. Bingo!
Chromium related browsers seems to not respect xdg settings on not full-fledged Desktop environments like i3wm which I use. Because the problem was not reproducible when I logged in with xfce4 session.

Unable to Edit Sublime Text's Default Settings

I would like to edit my default settings in Sublime Text 3 (beta build 3059) to not ignore the Vintage package - via Preferences > Settings - Default. I am running Sublime Text on Windows 7 Pro x64.
The Vintage package's documentation says to edit and save the default settings file to enable Vintage mode:
When I click the Settings - Default menu item, the default Preferences.sublime-settings file opens with expected content; but I cannot edit it. For example, deleting or backspacing to remove "Vintage" in "ignored_packages": ["Vintage"] does nothing.
I thought maybe the default settings file was marked readonly and tried to check it: C:\Users\me\AppData\Roaming\Sublime Text 3\Packages\Default\Preferences.sublime-settings does not exist. C:\Users\me\AppData\Roaming\Sublime Text 3\Packages\Default does not exist either.
To work around this, I tried to save the default settings file that Sublime Text opened for me - to see if that would create the Default directory and Preferences.sublime-settings in it. Instead Sublime Text gave the following error:
Unable to save C:\Users\me\AppData\Roaming\Sublime Text 3\Packages\Default\Preferences.sublime-settings
Error: The system cannot find the path specified.
Has anyone encountered this issue with Sublime Text 3 (specifically in trying to enable Vintage mode or otherwise) and worked around it...or found an authoritative explanation for it?
I reason that next I could try to add the missing Default directory myself, create an empty Preferences.sublime-settings text file in it, and try again to save the default settings file that Sublime Text opened for me; but this is starting to feel kludgy.
You should not edit the default settings. Add the files you want to ignore to the file Packages/User/Preferences.sublime-settings. You can open this file by going to Preferences - >Settings - User. Anything you set here will override the default settings.
I understand that you want to Not ignore the Vintage rather.
This still can be done using the Preferences.sublime-setting-User. AFAIK, any value given in this file overwrites the entries in Preferences.sublime-setting-Default.
Simply add this line with the "Vintage" removed in it to your User preferences and you'll be fine. (Remember to save the file after you did the edit and the change will happen instantly)
Also, not that VI mode in sublime is on edit more by default so make sure you press Esc first to make sure VI is activated.
// Settings in here override those in "Default/Preferences.sublime-settings",
// and are overridden in turn by file type specific settings.
{
"ignored_packages": []
}
Update
The latest format is,
{
"ignored_packages":
[
// Line below is commented out to enable Vintage.
//"Vintage"
],
// To start Sublime in Command moder
// rather than Insert mode.
"vintage_start_in_command_mode": true
}
Install 'PackageResourceViewer' from 'Install Package' in the Command Palette.
Then use 'PackageResourceViewer' command in the Command Palette.
Use that to extract/open the default packages you previously were unable to.
More information here : https://github.com/skuroda/PackageResourceViewer
I use Sublime Text3 recently in Windows 10. I'm trying to change the file: Packages/User/Preferences.sublime-settings. And met your problem "Enable to sa ve Preferences.sublime-settings".
I solve this by changing file Preferences.sublime-settings's property, in Security, edit "user"'s permissions. Allowed to modify.
And then I can edit and save Preferences.sublime-settings
When I install Sublime Text in Linux, I report the message NOTADIRECTORYERROR: [ERRNO 20] NOT A DIRECTORY. At first I thought it was because the Defalut folder was missing, but later I realized it wasn't. I then checked the Settings of my SublimeREPL. Sublime-setings and deleted the contents after bin, and found that the program worked fine.
old: "default_extend_env": {"PATH": "{PATH}:/home/bgnv5/anaconda3/bin/python"},
new: "default_extend_env": {"PATH": "{PATH}:/home/bgnv5/anaconda3/bin/"},
Spent a lot of time to find problems, I hope to help you.

How to change Active configuration in monodevelop?

I'm following these steps to build sdrsharp on stable Debian. So fr, everything went without a hitch, but I can't figure out this step:
cd into the new sdrsharp directory and then load monodevelop and open the sdrsharp.sln project. If the .sln doesn't open use a text editor to open the .sln file and at the end of the first line change the 12.00 to 11.00. Older versions of monodevelop don't understand the VS2012 header.
Set the Active Configuration from Debug|x86 to Release|x86.
The first one is just given for context, monodevelop has no problem opening the file. But how do I change the Actove Configuration?
Monodevelops internal help is broken, I have no experience with monodevelop or similiar tools as I'm no coder, hence asking here.
Edit to add
The same question was asked and answered here, there should be an option under the "project" tab. But in my case, working from the downloaded .sln, all options under project are grayed out. What to do?
Fixed! The Version had to be changed back to 11 (first bullet point above, relevant to my special case), then reopen file, then it's opened as a project, not as a text file and all the options work.
Take home lessen: That a progeam opens a file without complaining does noit mean there's no error.

How to stop opening files in browser upon save

I'm using Sublime Text 2 (which I love). I have it set to auto-save upon lost focus, to it automatically saves. Somehow, however, I've done something such that when it saves, it opens in a browser. This must be some build function that's getting triggered, but I don't know where to look for it. I looked for a BuildOnSave package in the installed packages, but I didn't see anything remotely related to 'Save' or 'Build', etc.
Does anyone have any ideas of where to look? I don't really want to have to revert to pristine state and then have to re-install my plugins as this us pretty darn annoying.
My currently installed packages are below, if it helps.
"installed_packages":
[
"AMD Module Editor",
"CoffeeScript",
"Dayle Rees Color Schemes",
"Emmet",
"Emmet Css Snippets",
"Git",
"Gitignore",
"JSLint",
"LESS",
"Markdown Preview",
"Package Control",
"SublimeLinter"
],
Thanks,
Scott
Try disabling Markdown Preview, as it looks like it could be the culprit. It has some built-in build systems, and you likely somehow activated a "build on save" feature. None of the other packages (that I'm aware of) have similar functionality that would give the symptoms you're seeing.
To deactivate, select Preferences -> Browse Packages... to open a file browser window of the Sublime Text 2 Packages directory. Move (don't copy) the Packages/Markdown Preview directory to someplace else, like your Desktop, for now. Quit and restart ST2, and see if the issue persists. If not, this plugin was at fault, and you can start poking around in its settings (after moving it back to the Packages folder) to see where the error is. One place to look is in Tools -> Build System and deselect Markdown.
Good luck!

Where does Sublime Text 2 store editing information?

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.