73

Is it possible to copy Atom from one Mac to another, including all installed packages, settings etc?

brainray
  • 12,512
  • 11
  • 67
  • 116
  • Possible duplicate of [How to save atom editor config and list of packages installed](http://stackoverflow.com/questions/30006827/how-to-save-atom-editor-config-and-list-of-packages-installed) – Damjan Pavlica Feb 05 '16 at 11:21

6 Answers6

122

There are several ways to synchronize your settings and packages between Atom installations:

  • Git: Create a public or private Git repo and store the contents of your local ~/.atom folder in there. Ignore the following files/directories in a .gitignore file:

    storage
    compile-cache
    dev
    .npm
    .node-gyp
    
  • Use a package like sync-settings. This will store your configuration in a GitHub Gist.

  • Dropbox (or similar): Move your ~/.atom folder to your Dropbox folder and then symlink it from there to its original location. This has the downside of syncing everything in ~/.atom, even the things you could ignore.

  • Use stars to select your favorite packages. On the Atom web site, create an account and mark your favorite packages with stars. Then use apm stars --install to install all starred packages on any machine. Downside: This only works for packages, not for settings.

More details:

nwinkler
  • 52,665
  • 21
  • 154
  • 168
  • awesome, super helpful – Zach Dec 02 '15 at 03:28
  • 4
    The third option - using stars - works fine. Would however be great if it was build into the Atom editor: Login and be able to sync both installed and stared packages. – Netsi1964 Dec 29 '15 at 09:03
  • 4
    I just installed Atom `1.11.2` and it generated `~/.atom/.gitignore` containing all of the above plus a bit more. :) – tjstankus Nov 08 '16 at 21:21
  • Thanks for this answer! Very helpful :-) – Sam Conran Oct 01 '17 at 21:25
  • With the first option, you would sync the contents of the `packages` subfolder which holds all the source code of all the packages! Better use something like [package-sync](https://atom.io/packages/package-sync) in combination with that approach, and add "packages" to your `.gitignore` – thutt Nov 08 '17 at 11:48
  • 2
    How safe is it to commit the config.cson file in a public git repository considering the fact that the ID of the user `uderId` is in there ? – Antoine Dec 18 '17 at 17:10
  • There's some discussion on that here: https://github.com/atom/metrics/issues/18 Having said that, if you're concerned about privacy, you probably should be careful with storing anything in a public Git repo. – nwinkler Dec 19 '17 at 10:39
  • `.atom-socket-secret-*` needs to be added to .gitignore --> https://github.com/atom/atom/issues/19334 – Andi Hafner Jun 28 '19 at 04:41
23

As a user who uses a dotfile management system such as RCM, I prefer independent config files.

For now, Atom doesn't officially provide a packages.cson file to manage plugins, but as the post Syncing settings & packages between machines mentioned, there is a plugin called package-sync that will generate a packages.cson file for us.

So with the help of package-sync, now I can just sync those mininal config files to have my Atom settings and packages consistent across multiple machines.

This is how to do it (Use ubuntu as an example):

  1. Install Atom, and install package-sync through Edit-->Preferences-->Install as the screen shot shows: Install package-sync
  2. Open your command pallete and type: Create Package List and there will be a packages.cson file under your ~/.atom folder. Open Command palette Create Package List

  3. Edit the gitignore file:

    $ gedit ~/.atom/.gitignore

    Make sure the content is:

    blob-store compile-cache dev storage .node-gyp .npm .apm packages/ atom-shell/

    This is a screenshot of the .gitignore file: .gitignore

    This makes sure the content downloaded by Atom from the Internet will not get synced to your dotfiles repo.

  4. Move the .atom folder to the dotfile repo:

    $ mv ~/.atom ~/dotfiles/tag-atom/atom

  5. Relink the folder:

    $ ln -s ~/dotfiles/tag-atom/atom ~/.atom

    Or if you have rcm installed:

    $ rcup

  6. Now go to another machine, and install Atom and package sync. Update your dotfiles repo, and then Open your Atom command pallete and type: sync

Now your Atom settings will get synced and integrated with the RCM dotilfe management system.

This is the files in my ~/.atom folder that get synced: synced files

Anthony Kal
  • 2,729
  • 1
  • 20
  • 18
Hustlion
  • 2,203
  • 1
  • 19
  • 22
7

I recently built a package that syncs automatically your Atom settings and packages across multiple computers. A little bit like the bookmark synchronization mechanism in Google Chrome. It's called atom-package-sync. Maybe it could fit your needs.

enter image description here

Mathew
  • 670
  • 1
  • 11
  • 21
6

You can sync your packages via package-list.txt file and a simple shell script.

Create the package-list.txt file

apm list --installed --bare > package-list.txt

Install missing packages on another host

BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
INSTALLEd_PKGS=$(apm list --installed --bare)
for PKG in $(cut -f1 -d@ $BASEDIR/package-list.txt); do
    grep -q $PKG <<< $INSTALLEd_PKGS || apm install $PKG
done
kornieff
  • 2,389
  • 19
  • 29
cmcginty
  • 113,384
  • 42
  • 163
  • 163
4

The .atom folder contains the packages folder, which can be rather huge. Unfortunately OneDrive doesn't allow you to exclude folders, so I went with a git option.

I excluded the packages from git and instead I committed a text file containing my packages (my-packages.txt).

To re-install packages I need to run: apm install --packages-file my-packages.txt.

To generate the my-packages.txt, I need something like this on a Bash shell: ls packages | xargs -n 1 echo | cut -d/ -f1 > my-packages.txt

Nikolaos Georgiou
  • 2,792
  • 1
  • 26
  • 32
  • 1
    While this is a clever minimal solution to keep your packages in sync, it does not cover the config, keymap and styles. Especially the config is crucial to have the same behavior of your packages on all machines. – thutt Nov 08 '17 at 11:25
  • The [package-sync](https://atom.io/packages/package-sync) plugin basically does the same but has Atom UI integration to save yourself from remembering bash commands or wrapping them in a custom script. – thutt Nov 08 '17 at 11:28
0

I sync my Atom settings between Windows, macOS, and Linux machines using Resilio Sync Home. It is free and the files are not saved on the "cloud" (like Dropbox or Gists), but it requires that, at least, two machines are online in order to sync the current settings.

I do not want to sync caches, installation specific settings, et al., I update the .sync/IgnoreList file that is created in the synced directory (i.e., the ~/.atom directory). Unfortunately, you will have to update this on each machine that you sync (ironically, the IgnoreList file is not synced). By default, the file specifies various temporary files to be omitted from syncing, so you'll need to add the following:

## Atom-specific
/packages/node-debugger/debugger.log
\packages\node-debugger\debugger.log
/.apm
\.apm
/.node-gyp
\.node-gyp
/.npm
\.npm
/blob-store
\blob-store
/compile-cache
\compile-cache
/dev
\dev
/recovery
\recovery
/split-diff
\split-diff
/storage
\storage

Some of the omitted directories are package-specific (e.g., split-diff). Because Windows has different path delimiters than other platforms, I need to specify both(!!)

  1. Install Resilio Sync Home on your first machine
  2. Add the .atom directory to Resilio to be synced.
  3. Update its IgnoreList file, as shown above. Save this file for the other machines you want to sync with.
  4. Send a Resilio "Read & Write" link of that folder to the other machines you want to sync with or copy the "Read & Write" key to be used on the other machines. To do this, in Resilio's folder view, click on the .atom folder's menu (vertical dots on the right edge) and select "Copy Read & Write key". Save it for later.

Then on your other machines,

  1. Install Resilio Sync Home
  2. Create .atom/.sync
  3. Copy the IgnoreList from your first machine to that directory
  4. Add the .atom directory to be synced with the other machine. You should add the folder using "Enter key or link," then enter the key you copyed, above.
  5. Wait until syncing is done before opening Atom. The first time will may take a few minutes.

Now I don't need to go around installing/removing packages on every machine, separately!

FYI: Changes to files and directories are saved in .sync/Archive, for some period of time, if you should need to recover them.

bill.lee
  • 2,207
  • 1
  • 20
  • 26