Sublime Forum

Per machine settings

#1

I debated wishing for this, since it’s probably a long shot to get implemented, but… it would be nice if we had a way of specifying per-machine settings. In my case, my laptop’s DPI is WAY higher than my desktop at work, so my font size needs to be larger. I just wrote a plugin to do this (see github.com/johnburnett/SublimeP … ettings.py ), but it feels very… icky :smile:.

Supporting something like “Base File.hostname.sublime-settings” would be neat…

Sidenote - is there a way to have a plugin that runs stuff once on startup, but after Sublime is “fully initialized”? The above plugin tries to do this by implementing on_activated, and then manually removing itself from sublime_plugin.all_callbacks’on_activated’], but again, that feels “icky”.

John

0 Likes

#2

Hm - having a race condition like that sounds even sketchier that manipulating a callback array. Think I’ll stick with that for now :smile:

0 Likes

#3

After mulling a bit more, I’ll re-state my original wish succinctly:

jps - It would be nice to add support for *.hostname.sublime-settings, where those settings only apply on the machine that has a matching hostname. These settings files would work in the pre-existing hierarchy that Sublime already supports (e.g. Default.sublime-settings, FileType.sublime-settings, User/Default.sublime-settings, etc), and applied last in the chain.

sublimator - I’m not modifying any arrays from within loops, so I’m not sure what you’re referring to. I’m not worried about hotloading support - the plugin does what I need now that I’ve pulled the settings out to a config file. Feel free to fork :smile:

Also, for those following along at home, I’ve split the plugins out - the repo previously listed is now at github.com/johnburnett/sublime-footools , and the per_host_settings.py plugin reads from a file named Packages/User/per_host_yourhostname.sublime-settings

0 Likes