Zed Settings Sync is an extension for Zed that aims to add support of automatically syncing your user-level config files to a Github Gist using LSP.
ℹ️ This extension doesn't sync project settings files because it's more pragmatic to just check them in the project's VCS repository if needed.
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.
When a corresponding Zed extensions repo PR is created and merged, you can simply download the extension in zed: extensions.
Until then, you can use the dev installation mode.
- Create a Github token with
gistpermission scope (detailed guide). - Prepare a Gist (detailed guide).
- Add credentials to your Zed settings file:
Ensure you have your Github token and Gist ID at hand.
- Install eget
- Run
eget vittorius/zed-settings-sync --to=~/.local/bin(or any other destination directory you prefer) - Pick the
zed-settings-sync-clibinary in the choice provided by eget - Run
zed-settings-sync-cli loadand follow the instructions
(Of course, you can download and unpack the binary manually from Github releases)
Given, you've configured everything correctly, now you can:
- edit the settings file ( or zed: open settings file)
- edit the keymap file ( or zed: open keymap file)
- edit tasks (zed: open tasks)
- edit debug tasks (zed: open debug tasks)
After the file is saved, either manually, or with the auto-save feature, it will be synchronized to the Gist you've specified.
ℹ️ At some point, Zed has added graphical interface for editing Settings and Keymap.
It pops up by default when you run zed: open settings or zed: open keymap workbench action.
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 edit your config files manually, as it was before.
Another approach could be swapping the keymap entries for zed: open settings or zed: open settings file (and for keymap file in a similar fashion):
{
"bindings": {
"cmd-,": "zed::OpenSettingsFile",
"alt-cmd-,": "zed::OpenSettings"
}
}- Open LSP logs (dev: open language server logs), find
settings-syncLSP server instance running for the specific settings file, and inspect its log - File an issue on Github
Requirements:
- Git
- Rust is required. The easiest way to get rust is by using rustup.
- Nextest test runner (some tests rely on it to be run without the need of cross-thread synchronization)
- iprecommit for Git hooks
- install
uv - change directory to where you cloned this repository
- do
uv venv - do
uvx pip install iprecommit - do
uvx precommit install
- install
- Clone this repository
- CTRL + SHIFT + P and select zed: install dev extension
- You may need to install additional build tool dependencies like XCode for macOS, Visual Studio build tools for Windows, etc. See
zed: open log for more details when seeing
Error: Failed to install dev extension: failed to compile Rust extensionpopup while trying to install the dev extension.
- You may need to install additional build tool dependencies like XCode for macOS, Visual Studio build tools for Windows, etc. See
zed: open log for more details when seeing
- Choose the directory where you cloned this repository
- After installing the extension, reload the workspace (workspace: reload) to start the LSP server
Run
cargo xtask-lsp-installto install the LSP server binary from your local repository to the Zed extension directory. Then, run workspace: reload action within your Zed instance for your dev extension to catch up the updated LSP server binary.
{ "lsp": { "settings-sync": { "initialization_options": { "github_token": "gho_my-shiny-token", "gist_id": "deadbeefdeadbeefdeadbeefdeadbeef" } } } }