yrichs
yrichs

Reputation: 43

sublime theme in project settings

I have some projects. I have several windows open at the same time and I get confused in them. Is it possible in the project settings to set for each project its own theme (design)? try

    {
    "folders":
    [
        {
            "path": "server"
        },
        {
            "path": "sources"
        }
    ],
    "settings":
    {
        "tab_size": 4,
        "save_on_focus_lost": true,
        "theme": "Adaptive.sublime-theme"
    }
}

its not work

Upvotes: 0

Views: 144

Answers (2)

Digital Ninja
Digital Ninja

Reputation: 3731

Indeed you cannot customise the theme per project, but you might have some luck with your problem by customising the colour scheme instead. It goes under the settings section where you tried to put the theme. So your .sublime-project file may look something like this:

{
    "folders":
    [
        {
            "path": "/path/to/my/project/"
        }
    ],
    "settings":
    {
        "color_scheme": "Packages/Visual Studio Dark/Visual Studio Dark.tmTheme",
    }
}

Hope that works out for you 👍‍‍

Upvotes: 1

OdatNurd
OdatNurd

Reputation: 22791

It's not possible to customize the Theme per window, no. Specifically, project specific settings can only include Editor Settings and not User Interface Settings or Application Behaviour Settings.

When you open the preferences window, the left pane contains the Default settings file. The settings at the top of the file are Editor settings; there is a clear delineation via comment that shows when the User Interface and Application Behaviour start.

    // When drag_text is enabled, clicking on selected text will begin a
    // drag-drop operation. This is not currently implemented under Linux.
    "drag_text": true,

    //
    // User Interface Settings
    //

    // The theme controls the look of Sublime Text's UI (buttons, tabs, scroll bars, etc)
    "theme": "Default.sublime-theme",
    // Magnifies the entire user interface. Sublime Text must be restarted for
    // this to take effect. 1.0 is normal scale, 0.0 allows for auto-detection
    // based on text scale with older Linux configurations that don't fully
    // support GTK display scaling.
    "ui_scale": 0.0,

    //
    // Application Behavior 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,

The theme setting is the first User Interface setting and is thus not allowed in project specific settings. You can however make the windows visually distinct by using a different color_scheme in each one.

Upvotes: 2

Related Questions