How to save Atom editor config and list of packages installed

独自空忆成欢 提交于 2019-12-02 14:14:09

Use Git to version control your config file (~/.atom/config.cson), and any other config files (dotfiles) you may have.

You can then host your Git repository for free on somewhere like GitHub, and retrieve it on other computers simply by running git clone https://github.com/{username}/{repo}.

You can then keep it up to date using git push (to upload changes) and git pull (to download changes).

To track installed packages as well, you will need to run:

apm list --installed --bare > ~/.atom/package.list

And add that file to Git also. To restore, use:

apm install --packages-file ~/.atom/package.list

You can use the apm command to save/restore installed packages.

To export packages (only packages name):

apm list --installed --bare > ~/Gdrive/backup.txt

To import packages:

apm install --packages-file ~/Gdrive/backup.txt

On Linux apm is available if you install Atom from .deb file.

On OSX: open atom -> install shell command

Windows: apm in C:\Users\YOUR_NAME\AppData\Local\atom\bin

atom-package-sync is a package that I created a couple weeks ago. It works a little bit like the synchronization of Google Chrome, you just login and it syncs your packages and settings automatically across all your Atom instances.

I plan to release the source code for the server side in the coming weeks and add an export feature for alternative backups.

AtomTips

This question was already (if I understood you correctly) in how to sync Packages and settings for multiple computers in Github Atom Editor.

You might find the answer in a blog post I wrote. I hope it helps How to synchronize Atom between computers.

On OSX/macOS:

  1. Open Terminal on the computer which has the settings you want to preserve / sync to others.
  2. Move your ~/.atom folder to Dropbox or other synced service (~ represents your /users/<your_username> folder), like so:

    mv ~/.atom ~/Dropbox/atom
    
  3. Open terminal, and make a symlink that connects the place Atom expects its config to be (~/.atom), to your synced folder, like so:

    ln -s ~/Dropbox/atom ~/.atom
    
  4. On other computers you want to use these settings, open Terminal and run:

    rm -rf ~/.atom && ln -s ~/Dropbox/atom ~/.atom
    

    (This deletes the .atom folder and adds the symlink in one line.)

With this method, your settings are automatically in sync on each computer, no need to manually update anything.

The only potential bug I have noticed can occur if your settings specify a font which another computer does not have. Installing the font on that computer fixes. All packages, themes & settings installed by Atom are automatically there.

This same method can be used for many apps (WebStorm, Sublime Text, iTunes are a few examples).

The atom package manager supports starring packages, either online (through atom.io/packages and atom.io/themes) or on the commandline using

apm star <packagename>

or

apm star --installed

to star all of your installed packages.

Starred packages can then be easily installed using:

apm stars --install 

Note that starring packages requires logging in to atom.io using your github account.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!