Easy setup for Atom from dotfiles
I am using Atom more and more, so the time has come to set up the preferences and installed plugins for it more easily.
My dotfiles that I use on all MAC OS X and Linux machines are prepared for VIM and Sublime Text 3. So say welcome to Atom's config as well.
Cloning dotfiles repo
On a fresh machine, I normally install the editors I like and then clone my dotfiles repo and then call a script to do the rest of the setup.
git clone https://github.com/StefanScherer/dotfiles && cd dotfiles && ./sync.sh
This sets up the configs for VIM, Sublime Text and now also for Atom (as well as a lot of bash aliases, functions, etc.)
The sync.sh
script is just copying all .atom/
configs to ~/.atom/
directory. But this is only for key bindings and other preferences.
Enter Parcel
The difficult part was how to install a list of Atom packages and sync them between all of my machines. Atom does not create a list of installed packages. But there is a package parcel
that does exactly what I need.
So the sync.sh
just assures that the parcel
package is installed.
Packages / Parcel / Sync
Now just open Atom from command line or from your Dock and click on Packages / Parcel / Sync and all other packages will be installed.
You may have to reload or restart Atom. Then you have all your listed plugins and of course all your configs installed from your dotfiles repo.
Saving Config and installed Plugins
You can install other packages from menu or with apm install
. If you want to save your changes in your dotfiles repo, just click on Packages / Parcel / Sync again and an updated ~/.atom/packages.cson
files will be written.
Go back to the dotfiles repo and copy all files from ~/.atom/
back and commit and push it. I have my sync-atom-prefs.sh
script.
Now you can transport your favorite Atom settings to any machine.
Tested on Mac OS X and Linux at the moment.