Unable to Edit Sublime Text's Default Settings
Asked Answered
R

6

54

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:

Sublime Text 3 Vintage Package Documentation

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.

Rind answered 9/4, 2014 at 4:4 Comment(2)
I know a solution has been posted, but did you ever figure out why the file doesn't exist? I have the same problem; I'm on a Mac, but the "Default" folder was not created at all when running Sublime. Although the "User" file exists. And worse than you, my "Default" files are all empty rather than containing anything.Glandulous
@Gary, they just simply changed the way you meant to apply the settings in the 3rd edition and haven't caught up with the documentation yet. It's Beta you know. Check my answer for the fix.Bruges
V
80

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.

Vilipend answered 9/4, 2014 at 7:21 Comment(6)
Thanks. It may not change the bottom line, but note that I do not want to ignore the Vintage package, rather not ignore it.Rind
I read your similar advice not to edit the default settings file on the ST3 forums. The Vintage package's documentation is not consistent with this advice, though; and I agree with mindlube (in the same ST3-forums thread) that ST3's handling of an attempt to edit the default settings is not very graceful or clear. Maybe the Preferences > Settings - Default menu item should rather be Settings - Default (Readonly).Rind
@Rind Depending on if you are overriding the packaged files, it may or may not be read only. If you feel you really need to modify the defaults, use github.com/skuroda/PackageResourceViewer to open the file. Then make your edit and save. It will place the file in the proper location to override the existing file. Also note that if you were to go through the menu again and make an edit. It would save as you expect. Guess I forgot to follow up on that post. Honestly, I don't really reference the official docs all that much. They seem to be rarely updated and incomplete.Vilipend
My guess is that page is a duplicate of the docs he had for ST2, even though handling of packages has changed. Oh if you are working with ST3, you may be interested in using github.com/guillermooo/Vintageous instead of the built in vintage. It appears to be much more feature complete, and under active (visible) development. I'd assume all "Default" settings for any plugin are read only. But you can create a file of the same name in the User package, and it will merge with the defaults, overriding where appropriate.Vilipend
@GerardONeill That has to due with how ST3 packages files. You can in fact "edit" the defaults, though it takes a few extra steps compared to ST2. I mentioned should not edit because the original question specified making an empty file. This is how you would edit (override) the packaged files in ST3.Vilipend
I suppose I was a little terse -- I meant via the UI. It seems to me the intended functionality was that the defaults remain unedited, but rather to create your own using the 'Settings -- user' menu item. Obviously there would be 'work arounds'.. But I came here for the exact reason that J0e3gan did.. But your post did create the aha moment, and thank you for that. Just thought it could be more clear.Targe
B
3

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
}
Bruges answered 15/1, 2015 at 1:10 Comment(2)
According to these docs: You can also change that insert mode setting with "vintage_start_in_command_mode": trueHardset
What you mentioned is a true fact however it only works (by enabling to enter into sublime with Command mode rather than Insert Mode when it started) if the vi is enabled already.Bruges
J
1

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

Judas answered 8/2, 2015 at 8:4 Comment(0)
U
0

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

Unvarnished answered 24/5, 2017 at 3:52 Comment(0)
B
0

On Mac OSX (Ventura) I had to combine both @skuroda and @Mehrad's answers to achieve enabling Vintage mode.

  1. Navigate to ~/Library/Application Support/Sublime Text/Packages/User

  2. Create a file named Preferences.sublime-setting (vim Preferences.sublime-setting)

  3. Paste the following

    // Settings in here override those in "Default/Preferences.sublime-settings", // and are overridden in turn by file type specific settings. { "ignored_packages": [] }

  4. Save and exit (:x or :wq)

  5. Result is instant, you should now be able to enter and exit insert mode in Sublime Text

Brigittebriley answered 20/6, 2023 at 17:52 Comment(0)
S
-1

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.

Sexpot answered 26/3, 2021 at 20:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.