Sublime Forum

ST3: detect platform in user settings file?

#1

Hi,

I sync my ST3 settings across multiple computers with Dropbox so I get consistent experience. One thing that is different though is the font size - if I set the font to a certain size, it will look too small on OSX and too big on Windows. I would like to be able to detect the platform in my user settings file, something like:

	"font_size": 14 if platform.system() == "Darwin" else 12,

But that didn’t work. Is this possible to implement in the settings file or even in a plugin?

Thanks!

0 Likes

[solved] User settings per platform
#2

Through the file, no. Through a plugin, definitely. There are a couple of ways I could see doing it. The first is to basically rewrite your Preferences.sublime-settings file when the plugin loads. Though this would work, it would blow away any comments in your Preferences file so may not be ideal. The second is to apply the settings when a view is loaded. I recall someone writing a plugin that did this, but I can’t recall what it was off the top of my head. I’ll see if I can hunt it down.

0 Likes