Skip to content

Handle configuration files that are externally modified and also in different locations on difference machines #1312

Answered by twpayne
Tyrubias asked this question in Q&A
Discussion options

You must be logged in to vote

In the particular case of VSCode, VSCode has its own system for synchronizing settings. Depending on exactly what you want, this might be the best option for you.

For managing settings.json on chezmoi you could use a per OS-symlink back to the source state, something like:

~/.local/share/chezmoi/settings.json:

{ /* ... */ }

.local/share/chezmoi/.chezmoiignore:

settings.json
{{ if ne .chezmoi.os "darwin" }}
Library/Application Support/Code/User/settings.json
{{ end }}
{[ if ne .chezmoi.os "linux" }}
./.config/Code/User/settings.json
{{ end }}

.local/share/chezmoi/Library/Application Support/Code/User/symlink_settings.json.tmpl:

{{ .chezmoi.sourceDir }}/settings.json

.config/Code/User/sy…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Tyrubias
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants