Zed: Difference between revisions

Remote Server: setup clarification, simplification, and pro/cons.
Home-manager description: Extension oddities, grammar, formatting.
Line 66: Line 66:


== Home manager support ==
== Home manager support ==
Zed is supported by home-manager, this way you are able to make a reproducible Zed setup.
Zed is supported by home-manager, which allows you to make a reproducible initial Zed setup.
However, due to the method Zed uses for installing, running, and managing Extensions, only the initial set of preinstalled extensions can currently be defined in home-manager. It's possible to install additional extensions from the Zed GUI on any system without including it in the home-manager config. This is partially a technical limitation of the format of extensions (which follow a similar model to VSCode and require external binaries to be downloaded and used at run-time}, and a Zed extensions management design (that doesn't track the installed extensions in the settings but does allow a list to be manually added that will be auto-installed if not already present). 


'''userSettings''' option will be translated directly to '''json''' file.
The <code>userSettings</code> and <code>userkeyMaps</code> options will be translated directly into JSON.
The <code>extensions</code> currently just defines the <code>userSettings.auto_install_extensions</code> (see Zed documentation).
The <code>extraPackages</code> includes extra nixpkgs in the environment Zed executes in (an FHS), so extra LSP server packages (e.g. <code>pkgs.nixd</code>) or optional tools for LSP servers (e.g. <code>pkgs.shellcheck</code> for the "Basher" LSP) should be included. 


Note that home-manager configuration produces a '''read only <code>settings.json</code>'''. Zed assumes the <code>settings.json</code> is writable, and modifies it for all settings changed directly or indirectly from the GUI.  Using a read-only version will prevent changing features like the current working model of the AI engine, or switching between AI engines.
Note that home-manager configuration produces a <b>read only <code>settings.json</code></b>, but Zed <b>assumes/requires the <code>settings.json</code> to be writable</b>. Using home-manager configuration will prevent you from changing most settings in the GUI since Zed will be unable to modify the read-only <code>settings.json</code> accordingly.  This includes the current/default AI engine to use, or even switching the model of the AI engine (as well as most non-AI settings).


You can see an example of the home-manager configuration:
You can see an example of the home-manager configuration:
Line 81: Line 84:
         enable = true;
         enable = true;


         ## This populates the userSettings "auto_install_extensions" which is a very odd optional Zed setting.
         ## This populates the userSettings "auto_install_extensions"
        ## It is not automatically populated or updated by Zed itself, and is only used at Zed startup to verify
        ## these are present in the set of installed extensions. Other extensions may have been installed from the
        ## GUI and Zed will do nothing to change those.  Removing an extension from this list will NOT remove it from
        ## Zed, that must be done manually from the GUI for every Zed instance using this config.
         extensions = ["nix" "toml" "elixir" "make"];
         extensions = ["nix" "toml" "elixir" "make"];