Skip to content

Zed Setup

Zed

Zed is a code editor with clean and minimalistic interface.

Zed includes built-in language support, with extensions available to add additional functionality.

Python

Python is supported natively, with basedpyright for language intelligence and Ruff for linting and formatting.

C/C++

C and C++ are supported natively through clangd, which provides code completion, diagnostics, navigation, formatting, and refactoring.

Rust

Rust is supported natively through rust-analyzer, which provides code completion, navigation, diagnostics, refactoring, and inlay hints.

Zed provides built-in support for HTML, CSS, JavaScript, and TypeScript, with language intelligence, navigation, and formatting.

I recommend installing MacTeX and the LaTeX extension for Zed. MacTeX provides everything needed to run LaTeX on macOS, while the LaTeX extension provides syntax highlighting, language support, linting, and build integration.

  1. Install the zed command in the PATH:

    Open Zed, press ⌘ Shift P to open the Command Palette, and run:

    cli: install cli binary
  2. Update the Zed settings:

    Open Settings with ⌘ , and use:

    {
    "outline_panel": {
    "dock": "left"
    },
    "soft_wrap": "bounded",
    "buffer_font_family": "JetBrainsMonoNL Nerd Font",
    "disable_ai": true
    }
  3. Set Zed as your default Git editor, diff, and merge tool:

    Terminal window
    git config --global core.editor 'zed --wait'
    git config --global diff.tool zed
    git config --global difftool.zed.cmd 'zed --wait --add --diff $LOCAL $REMOTE'
    git config --global merge.tool zed
    git config --global mergetool.zed.cmd 'zed --add --wait $MERGED'
  4. Add a task for building LaTeX documents:

    Open the Command Palette with ⌘ Shift P, run zed: open tasks, and add:

    [
    {
    "label": "Build LaTeX",
    "command": "latexmk",
    "args": [
    "-lualatex",
    "-shell-escape",
    "-synctex=1",
    "-interaction=nonstopmode",
    "-auxdir=build",
    "-outdir=build",
    "$ZED_FILE"
    ],
    "cwd": "$ZED_WORKTREE_ROOT",
    "save": "current"
    }
    ]

    Run Build LaTeX with ⌘ Shift R.