|
1 | 1 | --- |
2 | | -title: Zed |
3 | | -description: My Zed editor setup. |
| 2 | +title: Zed guide |
| 3 | +description: How to use Zed for agentic coding. |
4 | 4 | --- |
5 | 5 |
|
6 | | -My Zed editor setup goes here. |
| 6 | +## Shortcuts |
| 7 | + |
| 8 | +| Shortcut | Description | |
| 9 | +| :------- | :------------------ | |
| 10 | +| `⌘ B` | Toggle left dock. | |
| 11 | +| `⌘ R` | Toggle right dock. | |
| 12 | +| `⌘ ⇧ E` | Show project panel. | |
| 13 | +| `⌘ ⇧ G` | Show Git panel. | |
| 14 | +| `⌘ ⇧ B` | Show outline panel. | |
| 15 | +| `⌘ ?` | Show agent panel. | |
| 16 | +| `⌃ ⇧ R` | Review changes. | |
| 17 | +| `@` | Add to context. | |
| 18 | + |
| 19 | +## Worktrees |
| 20 | + |
| 21 | +Workspace isolation is done with Git [worktrees](/guides/worktrees). You can manage worktrees with |
| 22 | +`git: worktree`. This works well except for the creation of new worktrees. Zed thinks that all |
| 23 | +worktrees it creates should be located in one central (but customizable) directory. And it does not |
| 24 | +support creating worktrees from existing branches. |
| 25 | + |
| 26 | +## Orchestration |
| 27 | + |
| 28 | +Use one worktree per window. The UI is not designed to run multiple agents in parallel. You can do |
| 29 | +this with one window per agent, but there is no good way to manage all the running agents. |
| 30 | + |
| 31 | +## Code reviews |
| 32 | + |
| 33 | +### Review files changed by agent |
| 34 | + |
| 35 | +You can look at uncommitted changes with `git: diff`. You can stage or restore changes one by one, |
| 36 | +but that is usually not what you want. When there are uncommitted changes made by an agent, you will |
| 37 | +see the **Review changes** button. Alternatively, you can use the keyboard shortcut to open this |
| 38 | +view. In this view, you can accept or reject the agent's changes one by one. |
| 39 | + |
| 40 | +When you do this is up to you. You might do a few iterations with the agent without looking at the |
| 41 | +code and then review, or you might review changes in every iteration. You can also copy all the |
| 42 | +diffs and add them to your agent's context, or rather another agent's context, and let the agent do |
| 43 | +a code review. |
| 44 | + |
| 45 | +### Pull request review |
| 46 | + |
| 47 | +One downside of Zed is that it does not yet have anything that matches |
| 48 | +[GitHub's pull requests extension](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github). |
| 49 | +You have to find a different workflow to do pull requests. |
| 50 | + |
| 51 | +Since you can't create a worktree from the pull request branch in Zed, you need to create a worktree |
| 52 | +for the review manually. With `git: branch diff`, you can create a diff between the default branch |
| 53 | +on origin and the branch you are on. It is currently not possible to diff against another branch, |
| 54 | +for example when you stack pull requests. |
| 55 | + |
| 56 | +You can create a diff and send it to your current agent for a first review. |
| 57 | + |
| 58 | +Two more useful features for exploring the pull request are the Git graph and the file history, |
| 59 | +which you can access for each file with a right-click. |
| 60 | + |
| 61 | +A big downside is that you cannot write line comments during a pull request review in Zed. You need |
| 62 | +to switch context to the Git provider's website. |
| 63 | + |
| 64 | +## Resolve merge conflicts |
| 65 | + |
| 66 | +Zed has built-in merge conflict resolution (not tested yet). |
0 commit comments