Zed Settings Sync is an extension for Zed that aims to add support of automatically syncing your global and per-project config files to a Github Gist using LSP.
Using LSP is a workaround because of the limited capabilities of current Zed extensions API.
Such an approach is heavily inspired by Zed Discord Presence extension.
rust is required for installing this extension.
The easiest way to get rust is by using rustup.
- Clone this repository
- CTRL + SHIFT + P and select zed: install dev extension
- Choose the directory where you cloned this repository
- Enjoy :)
When a corresponding Zed extensions repo PR is created and merged, you can simply download the extension in zed: extensions.
This is the easiest way.
- Install the official Github CLI
- Login to Github using it
- Ensure your token has the
gistOAuth scope (it should, by default):
gh auth status- Copy your token to the clipboard and paste it into your configuration file:
macOS:
gh auth token | pbcopyLinux:
gh auth token | xclip -selection clipboardWindows:
gh auth token | clip- Paste it into your Settings Sync configuration:
- Create a new token at Github.
- Ensure it has Gists permission under the Account.
- Perform all of the steps from the previous section to land this token into your Settings Sync LSP server configuration.
You need to create a Gist or have an existing one. If you're creating a new one, remember that it cannot be empty or contain zero-sized files. So, to create a Gist for our purposes, again, we have 2 options.
macOS / Linux:
echo "// Zed Settings\n\n{\n}\n" | gh gist create -f settings.json -d "Zed Settings"Windows:
echo //^ Zed^ Settings| gh gist create -f settings.json -d "Zed Settings"macOS / Linux:
curl -X POST -H "Authorization: token <your Github token>" -H "Content-Type: application/json" -d '{"description": "Zed Settings", "public": false, "files": {"settings.json": {"content": "// Zed Settings\n\n{\n}\n"}}}' https://api.github.com/gistsWindows:
curl.exe -X POST -H "Authorization: token <your Github token>" -H "Content-Type: application/json" -d "{\"description\":\"Zed Settings\",\"public\":false,\"files\":{\"settings.json\":{\"content\":\"// Zed Settings\n\n{\n}\n\"}}}" https://api.github.com/gists- Paste it into your Settings Sync configuration:
{
// ...
"lsp": {
// ...
"settings_sync": {
"initialization_options": {
"gist_id": "<your Gist Id>"
// ...
}
}
}
}{
"lsp": {
"settings_sync": {
"initialization_options": {
"github_token": "gho_nA8tK4GxW9eR1bY0uZqT7sL2pCjD5vFhE",
"gist_id": "e565898c6f664eb916c54de1e99ebe74"
}
}
}
}Given, you've configured everything correctly, now you can:
- edit global Zed settings (zed: open settings or zed: open settings file)
- edit project settings (zed: open project settings)
- edit the keymap (zed: open keymap or zed: open keymap file)
- edit tasks (zed: open tasks)
- edit project tasks (zed: open project tasks)
- edit debug tasks (zed: open debug tasks)
- edit project debug tasks (debugger: open project debug tasks)
After the file is saved, either manually, or triggered by the auto-save feature, it will be synchronized to the Gist you've specified.
ℹ️ Recently, Zed has added graphical interface for editing Settings and Keymap. When using such an editor, click Edit in settings.json or Edit in keymap.json respectively.
You can go back to the visual editor and use it afterward, just keep the corresponding JSON settings file open for it to be caught by LSP and synchronized appropriately.
Or, of course, you can play hard and edit your config files manually, as it was before.
- Open LSP logs (dev: open language server logs), find Settings Sync LSP server, and inspect its log
- File an issue on Github
- TODO: install rust and other components via rustup
- TODO: install iprecommit (install uv, do uv venv, do ux pip install iprecommit)
- TODO: other neccessary setup
{ // ... "lsp": { // ... "settings_sync": { "initialization_options": { "github_token": "<your Github token>" // ... } } } }