Is it possible to set host-specific settings in config.cson


#1

Hi there,

I am using Atom on several machines. In general I want to have the same config.cson for both machines, especially for regular workflow settings (tabs/spaces etc.) and my spellcheck-dict. So I version-control and link it to the respective user-folders ~/.atom on each machine.

However the machines require few settings to be different, e.g., the font-size due to the display capabilities. So atm I have to have multiple config.json files that I merge manually from time to time.

Is there a way to set hostname-specific settings? I think of something like:

"*":
  core:
    audioBeep: false
...
"*.machine.a":
  editor:
    fontSize: 20
...
"*.machine.b":
  editor:
    fontSize: 15

Thanks in advance.


#2

If you version control with git, you could keep them as separate branches. Given the infrequency of changes to config.cson, if I were using your setup I would just copy changes manually. Over an SFTP connection, it would just take a few seconds to paste over some changes and that’s unlikely to be done more frequently than every few weeks. The thing I would be worried about is forgetting, but then I might write an init.coffee routine to watch config.cson and notify me when it changes.


#3

Thanks for your reply.

I simply have them im git side by side and merge changes with meld. So they diverge over time and every other week I merge. The init-idea is something I will check out though.

Apparently this file changes very frequent, because of the manually added known words for the spell checker. These are stored in that file.

Hmm.


#4

Ha! Your pushed me in the right direction :grinning:

I unified the config.cson for all machines and will now use machine-specific init.coffee scripts to set the special properties.

For my font size issue this was a mere:

# Your init script
atom.config.set('editor.fontSize', '20');

Thanks a bunch!


#5

Glad you found something that works.