hermiod

Set up Zed with a uv managed python environment

I wanted to set up my Zed code editor with a uv-managed python project. Here's how I did it:

Setting up language features

In ~/.config/zed/settings.json (or a project specific .zed/settings.json

  "lsp": {
    "pyright": {
      "settings": {
        "python": {
          "pythonPath": ".venv/bin/python"
        }
      }
    }
  },

should make sure that you're pointing to the right virtual environment.

Setting up the REPL

Run in your project with the virtual environment activated:

uv run ipython kernel install --user --name=$PROJECT_NAME

Now restart zed or run repl: refresh kernelspecs inside zed. When you run repl: run it should connect to that one.