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.
The Problem
Section titled “The Problem”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.
Platform Keys
Section titled “Platform Keys”Devsync supports four platform keys in manifest.json:
| Key | Platform |
|---|---|
win | Windows |
mac | macOS |
linux | Linux |
wsl | Windows 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.
The localPath Format
Section titled “The localPath Format”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.
Setting Up Platform-Specific Paths
Section titled “Setting Up Platform-Specific Paths”devsync track records the path as it exists on the current platform. To add paths for other platforms, you edit manifest.json directly.
# On Linux/macOSdevsync track ~/.config/nvim
# On Windowsdevsync track ~/AppData/Local/nvimThis creates an entry with a plain string localPath for the current platform.
Open manifest.json in the sync directory:
devsync cdvim manifest.jsonChange the plain string to an object:
{ "localPath": { "default": ".config/nvim", "win": "AppData/Local/nvim" }, "mode": "normal", "profiles": []}Save and exit.
# Still inside devsync cd shellgit add manifest.jsongit commit -m "Add Windows path for nvim config"git pushexitExample: Common Cross-Platform Configs
Section titled “Example: Common Cross-Platform Configs”Neovim
Section titled “Neovim”{ "localPath": { "default": ".config/nvim", "win": "AppData/Local/nvim" }, "mode": "normal", "profiles": []}VS Code settings
Section titled “VS Code settings”{ "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": []}SSH config
Section titled “SSH config”{ "localPath": ".ssh/config", "mode": "secret", "profiles": []}SSH config lives at ~/.ssh/config on all platforms, so no platform variant is needed here.