Sublime Forum

How to override <plugin>.sublime-settings

#1

Hi,

Problem
I have defined a workspace and havea GoPlugin installed with its GoSublime.sublime-settings like

{
    "env": {
        "GOPATH": "C:\\go1.12.9.windows-amd64\\gopath;D:\\MyWork\\xyz",
        "GOROOT": "C:\\go1.12.9.windows-amd64\\go"
    }
}

which works, … BUT due to project differences I want GOPATH to differ for each project.

I searched a lot of official docs, and this blog comes close to what am asking but the solution is lost in some chatter

I tried, (and please also tell me why something like this cant work):
In my <project>.sublime-project:

...
	"settings":
	{
	    "env": 
		{
                     "GOPATH": "C:\\go1.12.9.windows-amd64\\gopath;D:\\MyWork\\xyz",
                     "GOROOT": "C:\\go1.12.9.windows-amd64\\go"
		}
	},
	"build_systems":
    [
        {
            "name": "Update GO Path",
            "shell_cmd": "SET GOPATH=%GOPATH%;D:\\MyWork\\xyz"
        }
    ]
...

Side Note: Placing Windows environment variables instead of absolute paths also fails. Thats another question in itself.

0 Likes

#2

I think we had a package that allowed for this, but the solution will always be hacky. The only one with a potentially matching feature set doesn’t seem to exist anymore (https://packagecontrol.io/packages/SuperSettings).

That said, GoSublime supports per-project settings natively, so just follow the documentation:

https://github.com/DisposaBoy/GoSublime/blob/development/USAGE.md#per-project-settings--project-based-gopath

1 Like

#3

Works !

Makes sense to define overrides per plugin. thanks

0 Likes