Sublime Forum

Sublime text 3 and overriding settings per project doesn't work

#1

I’ve setup to my user settings on sublime text 3, the following option: trim_trailing_white_space_on_save: true

But it seems our collagues in a project have different opinion. So I have to override this setting per project (I wanted it enabled to other projects, I just want to be skipped on a specific one). I’ve tried by creating a file .sublime-workplace and/or .sublime-project on the root of the project folder and I added the following:

{
“settings”:
{
“trim_trailing_white_space_on_save”: false
}
}

But when I save a file with whitespaces, it still keeps trimming them. If I remove it from my user settings it works correctly. What am I doing wrong? Is there specific settings which I can bypass per-project? If yes, is there another way of doing that (maybe a sublime plugin or something).

0 Likes

#2

This works for me in one of my projects, so this is totally a setting that can be modified per-project. I’m pretty sure not all can be but I’m having trouble thinking of an example so I may be hallucinating.

Based on your description above, the problem might be that you just created the project file but didn’t actually open it, e.g. via Project > Open Project...; just having a project file in a directory you have open isn’t enough to have Sublime use it.


Just to clarify, you probably want your project file to look something like the following; without a list of folders to include in the side bar, the project will be initially empty and not show you the contents of the directory that it’s stored in. By including the . path, the side bar will show you the contents of the directory that the project is stored in, which is probably closer to what you were trying to do.

Alternatively I think you could probably also just do Project > Save Project as... from the menu in your existing window to save the project with all of the folders and state that you currently have, and then use Project > Edit Project to modify the settings.

{
	"folders":
	[
		{
			"path": "."
		}
	],
	"settings":
	{
        "trim_trailing_white_space_on_save": true
	}
}
1 Like

#3

Hey!

Show us your full something.sublime-project, there’s maybe a mistake.

Which build of ST3 are you using?

Matt

0 Likes

#4

Thank you for your interest guys!

Seems like I haven’t created this folder as a project. So I’ve made it a project through sublime (it added the folder path) and then I open it using this file and it worked. I thought initially that it just need this file to be on the root of the folder and I don’t need to do anything else.

1 Like