Create symbolic link to .atom directory?


I have Atom installed on my main partition. I created a new partition for Yosemite.

When I open Atom on Yosemite, none of my settings or packages load. I know it’s due to the folder .atom being in my old path instead of where Atom expects it.

So I tried

steves-mbp:~ stevelombardi$ ln -s /Volumes/Macintosh\ HD/Users/stevelombardi/.atom .atom

Although the directory is “created” (I assume symlinked) Atom still starts up with defaults. How would I do this, so starting it with either partition booted will use the same folder?


Hmm, weird. What does this produce?

$ ls -la ~/.atom

I’m guessing the symlink is broken, or it could potentially be a permissions issue.


When run on the Yosemite home directory (Macintosh HD 2), I get:

steves-mbp:~ stevelombardi$ ls -la ~/.atom
total 56
drwxr-xr-x  11 stevelombardi  staff  374 Jun 24 09:53 .
drwxr-xr-x+ 28 stevelombardi  staff  952 Jun 24 09:51 ..
lrwxr-xr-x   1 stevelombardi  staff   47 Jun 24 09:53 .atom -> /Volumes/Macintosh HD/Users/stevelombardi/.atom
-rw-r--r--   1 stevelombardi  staff   41 Jun 24 09:51 .gitignore
drwxr-xr-x   5 stevelombardi  staff  170 Jun 24 09:54 compile-cache
-rw-r--r--   1 stevelombardi  staff  271 Jun 24 09:54 config.cson
-rw-r--r--   1 stevelombardi  staff  459 Jun 24 09:51
-rw-r--r--   1 stevelombardi  staff  485 Jun 24 09:51 keymap.cson
drwxr-xr-x   3 stevelombardi  staff  102 Jun 24 09:51 packages
-rw-r--r--   1 stevelombardi  staff  415 Jun 24 09:51 snippets.cson
-rw-r--r--   1 stevelombardi  staff  282 Jun 24 09:51 styles.less

But the package directory only has the default contents, not what’s on the source HD:

steves-mbp:~ stevelombardi$ ls -la ~/.atom/packages/
total 8
drwxr-xr-x   3 stevelombardi  staff  102 Jun 24 09:51 .
drwxr-xr-x  11 stevelombardi  staff  374 Jun 24 09:53 ..
-rw-r--r--   1 stevelombardi  staff   60 Jun 24 09:51

Also, it says total 8, but only 1 file…


If you look at the first listing, you can see that your symlink exists inside ~/.atom instead of that directory being the actual symlink. To fix this, and also make sure we don’t accidentally delete something, let’s do the following

$ cd
$ mv ~/.atom ~/.atom.old
$ ln -s /Volumes/Macintosh\ HD/Users/stevelombardi/.atom ~/.atom

The first line simply changes the working directory to your home directory, the second line renames the current .atom folder to .atom.old as poor man’s backup. The third line symlinks the source directory (on your old partition) to the correct target, ~/.atom.

You should probably make sure all Atom instances are closed prior to doing this. You’ll likely need to restart it either way.


That indeed fixed it. I guess I forgot the ~/ the first time. Thanks.


I had a similar problem, but I wasn’t specifying the absolute URL for the source file. The third line also fixed this, as it provides the direct route to the .atom folder.