Skip to content

zed-editor: coexist with preexisting settings and shortcuts #6835

Open
@yajo

Description

@yajo

Description

HM replaces any user-chosen settings and keymaps when using one of these options:

This is problematic in zed as explained in the wiki:

note that home-manager configuration produces a read only settings.json this means some features which requires to write this file might not work. For example change model at runtime. Changing AI model at runtime tries to write in the configuration.

This makes zed less user-friendly when configured with HM. Instead, it would be better if it were able to merge values with those found within those files.

The joplin-desktop module for example already does that:

lib.hm.dag.entryAfter [ "linkGeneration" ] ''
# Ensure that settings.json exists.
mkdir -p ${builtins.dirOf configPath}
touch ${configPath}
# Config has to be written to temporary variable because jq cannot edit files in place.
config="$(jq -s '.[0] + .[1]' ${configPath} ${newConfig})"
printf '%s\n' "$config" > ${configPath}
unset config

This enables the user change settings dynamically within the app, while still making sure you get the ones you hardcoded in HM when reloading it.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions