Zed: Difference between revisions

Malix (talk | contribs)
m update, format, use native features
m fix typo in the option's name
 
(3 intermediate revisions by 2 users not shown)
Line 19: Line 19:
<!--T:1-->
<!--T:1-->
[https://zed.dev Zed]<ref>Zed Industries, "Zed", Official Website, Accessed October 2025. https://zed.dev</ref> is a collaborative, GPU-accelerated text editor developed by Zed Industries. It combines fast local editing with real-time multiplayer features and ships with batteries-included tooling for popular programming languages.
[https://zed.dev Zed]<ref>Zed Industries, "Zed", Official Website, Accessed October 2025. https://zed.dev</ref> is a collaborative, GPU-accelerated text editor developed by Zed Industries. It combines fast local editing with real-time multiplayer features and ships with batteries-included tooling for popular programming languages.
</translate>
 
<translate>
<!--T:2-->
<!--T:2-->
The editor provides native builds for Linux, including Nixpkgs packages and a reproducible flake. Hardware acceleration requires a GPU with Vulkan support; systems without Vulkan can fall back to emulation via tools such as [https://github.com/nix-community/nixGL nixGL].<ref>Zed Industries, "Linux", Zed Documentation, Accessed October 2025. https://zed.dev/docs/linux</ref>
The editor provides native builds for Linux, including Nixpkgs packages and a reproducible flake. Hardware acceleration requires a GPU with Vulkan support; systems without Vulkan can fall back to emulation via tools such as [https://github.com/nix-community/nixGL nixGL].<ref>Zed Industries, "Linux", Zed Documentation, Accessed October 2025. https://zed.dev/docs/linux</ref>
</translate>


<translate>
<!--T:5-->
{{Nixpkg|pkgs/by-name/ze/zed-editor|zed-editor}} is available in Nixpkgs since 24.11; However, Zed provides [https://github.com/zed-industries/zed/blob/main/flake.nix an official nix flake] which might be useful if you need features that have not yet reached unstable Nixpkgs.
 
== Installation == <!--T:3-->
== Installation == <!--T:3-->


==== Shell ==== <!--T:4-->
<!--T:6-->
The package installs both desktop launchers and a CLI entry point aliased to <code>zeditor</code>, mirroring the upstream binary name
 
=== Imperative === <!--T:4-->
 
==== Zed's Flake ==== <!--T:45-->
</translate>
</translate>


Line 35: Line 40:
</syntaxhighlight>
</syntaxhighlight>


<translate>
==== Nixpkgs ====
<!--T:5-->
The <code>zed-editor</code> package is available in Nixpkgs from channel 24.11 onward. The command above provides <code>zed-editor</code> in the current shell session without modifying any configuration files.


<!--T:6-->
<syntaxhighlight lang="console">
The package installs both desktop launchers and a CLI entry point aliased to <code>zeditor</code>, mirroring the upstream binary name.
nix run nixpkgs#zed-editor
</syntaxhighlight>


==== System setup ==== <!--T:7-->
<translate>
=== Declarative === <!--T:7-->
</translate>
</translate>
==== NixOS ====


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
# In /etc/nixos/configuration.nix
environment.systemPackages = [
environment.systemPackages = [
   pkgs.zed-editor
   pkgs.zed-editor
];
];
</syntaxhighlight>
{{Evaluate}}
==== Home Manager ====


# In home-manager configuration (home.nix)
<syntaxhighlight lang="nix">
home.packages = [
home.packages = [
   pkgs.zed-editor
   pkgs.zed-editor
];
];
</syntaxhighlight>
<syntaxhighlight lang="console">
home-manager switch
</syntaxhighlight>
</syntaxhighlight>


<translate>
<translate>
<!--T:8-->
==== Zed's Flake ==== <!--T:9-->
Rebuild your system or Home Manager profile to make Zed available persistently. On NixOS, run <code>sudo nixos-rebuild switch</code>; for Home Manager, run <code>home-manager switch</code>.
 
==== Flake ==== <!--T:9-->
 
<!--T:10-->
Zed maintains an official flake for tracking the latest upstream build. This approach is useful if you need features that have not yet reached stable Nixpkgs.
</translate>
</translate>


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
inputs.zed.url = "github:zed-industries/zed";
{
  inputs.zed.url = "github:zed-industries/zed";


outputs = { self, nixpkgs, zed, ... }@inputs: let
  outputs =
  system = "x86_64-linux";
    {
  pkgs = import nixpkgs { inherit system; };
      self,
in {
      nixpkgs,
  packages.${system}.zed-latest = zed.packages.${system}.default;
      zed,
};
      ...
    }@inputs:
    let
      system = "x86_64-linux";
      pkgs = import nixpkgs { inherit system; };
    in
    {
      packages.${system}.zed-latest = zed.packages.${system}.default;
    };
}
</syntaxhighlight>
</syntaxhighlight>


Line 81: Line 99:
<!--T:11-->
<!--T:11-->
Build the flake package with <code>nix build .#zed-latest</code> or expose it in your configuration with the appropriate overlay.
Build the flake package with <code>nix build .#zed-latest</code> or expose it in your configuration with the appropriate overlay.
</translate>
 
{{Warning|Zed requires hardware-accelerated Vulkan. On systems without supported drivers, use <code>nixGL</code> or home-manager's <code>nixGL.vulkan.enable {{=}} true;</code> to provide the necessary libraries.}}
<translate>
<!--T:12-->
<!--T:12-->
Providing Vulkan through <code>nixGL</code> can be more consistent than relying on host distribution packages, especially on non-NixOS systems where Wayland and X11 stacks differ in their Vulkan capabilities.
{{Warning|Zed requires hardware-accelerated Vulkan. On systems without supported drivers, use <code>nixGL</code> or home-manager's <code>nixGL.vulkan.enable {{=}} true;</code> to provide the necessary libraries.
Providing Vulkan through <code>nixGL</code> can be more consistent than relying on host distribution packages, especially on non-NixOS systems where Wayland and X11 stacks differ in their Vulkan capabilities.}}


== Configuration == <!--T:13-->
== Configuration == <!--T:13-->
Line 257: Line 274:


<!--T:19-->
<!--T:19-->
The <code>userSettings</code> and <code>userKeyMaps</code> options translate directly into JSON. The <code>extraPackages</code> option includes additional Nixpkgs in the FHS environment, useful for LSP servers (e.g., <code>pkgs.nixd</code>) or optional tools (e.g., <code>pkgs.shellcheck</code> for the Basher LSP).
The <code>userSettings</code> and <code>userKeymaps</code> options translate directly into JSON. The <code>extraPackages</code> option includes additional Nixpkgs in the FHS environment, useful for LSP servers (e.g., <code>pkgs.nixd</code>) or optional tools (e.g., <code>pkgs.shellcheck</code> for the Basher LSP).


<!--T:20-->
<!--T:20-->