Skip to content

Platform-Specific Paths

Manage the same config file under different paths on Windows, macOS, Linux, and WSL.

Some tools store their config in different locations depending on the platform. For example, Neovim’s config lives at ~/.config/nvim on Linux and macOS, but at %APPDATA%\Local\nvim on Windows. Devsync supports per-platform localPath variants to handle this.


When you run devsync track ~/.config/nvim on Linux, the entry records the Linux path. On Windows, you’d need a different path for the same logical entry. Without platform path support, you’d need two separate manifest entries — one per machine — and they’d conflict.


Devsync supports four platform keys in manifest.json:

KeyPlatform
winWindows
macmacOS
linuxLinux
wslWindows Subsystem for Linux

Note that wsl is treated as a separate platform from linux. A file running under WSL uses the wsl key, not linux.


A single-platform entry uses a plain string:

{
"localPath": ".config/nvim",
"mode": "normal",
"profiles": []
}

A multi-platform entry uses an object with a default key and optional platform overrides:

{
"localPath": {
"default": ".config/nvim",
"win": "AppData/Local/nvim",
"wsl": ".config/nvim"
},
"mode": "normal",
"profiles": []
}

During push and pull, devsync picks the value matching the current platform, falling back to default if no specific key is present.


devsync track records the path as it exists on the current platform. To add paths for other platforms, you edit manifest.json directly.

Terminal window
# On Linux/macOS
devsync track ~/.config/nvim
# On Windows
devsync track ~/AppData/Local/nvim

This creates an entry with a plain string localPath for the current platform.


{
"localPath": {
"default": ".config/nvim",
"win": "AppData/Local/nvim"
},
"mode": "normal",
"profiles": []
}
{
"localPath": {
"default": ".config/Code/User/settings.json",
"mac": "Library/Application Support/Code/User/settings.json",
"win": "AppData/Roaming/Code/User/settings.json"
},
"mode": "normal",
"profiles": []
}
{
"localPath": ".ssh/config",
"mode": "secret",
"profiles": []
}

SSH config lives at ~/.ssh/config on all platforms, so no platform variant is needed here.