Synchronize settings, keymaps, user styles, init script, snippets and installed packages across Atom instances.
$ apm install sync-settings
or using the Install button from Atom.io.
By default your backup will be stored in a gist, but you may also install other location packages.
Some other locations:
Open Sync Settings configuration in Atom Settings.
Create a new personal access token which has the gist
scope and be sure to activate permissions: Gist -> create gists.
Copy the access token to Sync Settings configuration or set it as an environmental variable GITHUB_TOKEN.
Create a new gist:
backup
command the first time.packages.json
as the filename.backup
commandCopy the gist id (last part of url after the username) to Sync Settings configuration or set it as an environmental variable GIST_ID.
Disclaimer: GitHub Gists are by default public. If you don't want other people to easily find your gist (i.e. if you use certain packages, storing auth-tokens, a malicious party could abuse them), you should make sure to create a secret gist.
"sync-settings":
gistId: "b3025...88c41c"
personalAccessToken: "6a10cc207b....7a67e871"
apm install sync-settings
GITHUB_TOKEN=6a10cc207b....7a67e871 GIST_ID=b3025...88c41c atom
Open the Atom Command Palette where you can search for the following list of commands.
Backup or restore all settings from the Packages menu or use one of the following commands:
sync-settings:backup
sync-settings:restore
View your online backup using the following command:
sync-settings:view-backup
Check the latest backup is applied:
sync-settings:check-backup
You can also fork existing settings from a different GitHub user using the following command:
sync-settings:fork
Create a new backup:
sync-settings:create-backup
Delete the current backup:
sync-settings:delete-backup
gist
scope and will be used for testing purposes.export GITHUB_TOKEN=YOUR_TOKEN
apm test
If you're going to submit a pull request, please try to follow the official contribution guidelines of Atom.
git checkout -b my-new-feature
).git commit -am 'Add some feature'
).git push origin my-new-feature
).Packages can provide a location service using Atom's Service's API
Add the keywords sync-settings
and location
and add the providedServices
property to your package.json
file.
// package.json
...
"main": "./main.js",
...
"keywords": [
...
"sync-settings",
"location"
],
...
"providedServices": {
"sync-settings-location": {
"versions": {
"1.0.0": "provideLocationService"
}
}
},
...
Then add the provideLocationService
function to your main.js
file (where your activate
function is for Atom to activate your package)
// main.js
...
activate () {
...
},
provideLocationService () {
return require('./locationService.js')
},
...
Return an object that provides the functions for your service.
// locationService.js
module.exports = {
/**
* Get URL for the backup
* @return {string} Backup URL. Return null if no URL exists
*/
async getUrl () {
...
},
/**
* Create new backup location
* @return {Object} Returns empty object on success. Falsey value on silent error
*/
async create () {
...
},
/**
* Get backup files and time
* @return {Object} Returns object with `files` and `time` on success. Falsey value on silent error
*/
async get () {
...
return {
files: {
'filename.txt': {
content: '...'
}
},
time: new Date().toISOString(), // ISO string, (e.g. 2020-01-01T00:00:00.000Z)
}
},
/**
* Delete backup
* @return {Object} Returns empty object on success. Falsey value on silent error
*/
async delete () {
...
},
/**
* Update backup and get time
* @param {Object} files Files to update
* @return {Object} Returns object with `time` on success. Falsey value on silent error
*/
async update (files) {
...
return {
time: new Date().toISOString(),
}
},
/**
* Fork backup
* @return {Object} Returns empty object on success. Falsey value on silent error
*/
async fork () {
...
},
}