NexusCS

Zed

Text Editors
Quick reference for Zed - a high-performance, multiplayer code editor built in Rust with built-in AI assistance and real-time collaboration.
featured

Getting started

Introduction

Zed is a high-performance, multiplayer code editor built in Rust. Designed for speed and collaboration with built-in AI assistance.

Installation

# macOS (Homebrew)
brew install zed

# macOS (Direct)
# Download from zed.dev

# Linux (Script)
curl -f https://zed.dev/install.sh | sh

# Build from source
cargo install --git https://github.com/zed-industries/zed

Quick start

# Open file
zed file.txt

# Open directory
zed .

# Open in existing window
zed --add file.txt

# Wait for file to close
zed --wait file.txt

Navigation

File navigation

Shortcut Action
Cmd+P Go to file
Cmd+Shift+P Command palette
Cmd+T Go to symbol
Cmd+Shift+O Go to symbol in file
Cmd+G Go to line
Cmd+\ Toggle sidebar

Window management

Shortcut Action
Cmd+K Cmd+↑/↓/←/→ Split pane
Cmd+K Cmd+W Close pane
Cmd+Alt+←/→ Switch tabs
Cmd+W Close tab
Cmd+Shift+T Reopen closed tab

Code navigation

Shortcut Action
F12 Go to definition
Cmd+F12 Go to implementation
Shift+F12 Find references
Cmd+U Go to type definition
Ctrl+- Go back
Ctrl+Shift+- Go forward

Editing

Basic editing

Shortcut Action
Cmd+D Add selection to next match
Cmd+Shift+L Select all occurrences
Cmd+/ Toggle comment
Cmd+Shift+K Delete line
Alt+↑/↓ Move line up/down
Cmd+Enter Insert line below

Multi-cursor

Shortcut Action
Cmd+Click Add cursor
Cmd+Alt+↑/↓ Add cursor above/below
Cmd+D Add next occurrence
Cmd+K Cmd+D Skip occurrence
Cmd+Shift+L Add cursor to all matches
Esc Clear extra cursors

Code actions

Shortcut Action
Cmd+. Quick fix
F2 Rename symbol
Cmd+Shift+R Refactor
Cmd+K Cmd+F Format selection
Cmd+Shift+I Format document

Search & Replace

Search operations

Shortcut Action
Cmd+F Find in file
Cmd+Shift+F Find in project
Cmd+H Replace in file
Cmd+Shift+H Replace in project
Cmd+G Find next
Cmd+Shift+G Find previous

Search options

# Regex patterns
\d+             # Match numbers
\w+             # Match words
.*              # Match anything

# Case sensitivity
for case-sensitive toggle

# Whole word
Option+W to toggle

Terminal

Terminal shortcuts

Shortcut Action
Ctrl+ ` Toggle terminal
Cmd+Shift+C Create terminal
Cmd+K Clear terminal
Cmd+T New terminal tab
Cmd+W Close terminal

Terminal commands

# Open terminal at current file
zed --terminal

# Run command in terminal
# Use integrated terminal panel

# Split terminal
Right-click > Split Terminal

Git Integration

Git commands

Shortcut Action
Cmd+Shift+G Open git panel
Cmd+K Cmd+G Stage changes
Cmd+K Cmd+U Unstage changes
Cmd+K Cmd+C Commit
Cmd+K Cmd+P Push

Git operations

# View diff
Click file in git panel

# Stage hunks
Click + on changed lines

# Discard changes
Right-click > Discard

# Commit
Cmd+K Cmd+C, type message, Enter

Blame & history

# Show blame
Right-click line > Git Blame

# View file history
Right-click file > Git History

# Compare with branch
Git panel > Compare with...

Vim Mode

Enable Vim mode

{
  "vim_mode": true
}

Normal mode

Key Action
h/j/k/l Move cursor
w/b Word forward/back
0/$ Line start/end
gg/G File start/end
dd Delete line
yy Yank line
p/P Paste after/before

Visual mode

Key Action
v Visual mode
V Visual line mode
Ctrl+V Visual block mode
gv Reselect last
o Toggle cursor

Insert mode

Key Action
i/a Insert before/after
I/A Insert line start/end
o/O New line below/above
s Substitute character
cc Change line
Esc Exit to normal

AI Assistant

AI commands

Shortcut Action
Cmd+/ Open AI assistant
Cmd+Shift+/ Quick AI action
Cmd+Enter Submit prompt
Esc Cancel AI action

AI prompts

# Code generation
"Generate a function that..."

# Code explanation
"Explain this code"

# Refactoring
"Refactor this to use async/await"

# Documentation
"Add JSDoc comments"

Collaboration

Multiplayer features

Shortcut Action
Cmd+Shift+J Share project
Cmd+Shift+C Copy share link
Cmd+Shift+F Follow collaborator
Cmd+Shift+U Unfollow

Collaboration workflow

# Share project
1. Cmd+Shift+J
2. Share link with team
3. Collaborators join

# Follow someone
Click avatar > Follow

# Chat
Use integrated chat panel

Configuration

Settings file

// ~/.config/zed/settings.json
{
  "theme": "One Dark",
  "buffer_font_family": "JetBrains Mono",
  "buffer_font_size": 14,
  "tab_size": 2,
  "soft_wrap": "editor_width",
  "vim_mode": true,
  "format_on_save": "on",
  "telemetry": {
    "metrics": false
  }
}

Key bindings

// ~/.config/zed/keymap.json
[
  {
    "context": "Editor",
    "bindings": {
      "cmd-s": "workspace::Save",
      "cmd-k cmd-s": "workspace::SaveAll",
      "cmd-n": "workspace::NewFile"
    }
  }
]

Extensions

Managing extensions

# Open extensions
Cmd+Shift+X

# Install extension
Search > Click Install

# Disable extension
Right-click > Disable

# Configure extension
Click gear icon

Popular extensions

Extension Purpose
Prettier Code formatting
ESLint JavaScript linting
Rust Analyzer Rust support
Go Tools Go language support
GitLens Enhanced git

Extension settings

{
  "language_servers": {
    "rust-analyzer": {
      "initialization_options": {
        "checkOnSave": {
          "command": "clippy"
        }
      }
    }
  }
}

Language Support

LSP configuration

{
  "lsp": {
    "typescript": {
      "initialization_options": {
        "preferences": {
          "includeInlayParameterNameHints": "all"
        }
      }
    }
  }
}

Language-specific settings

{
  "languages": {
    "TypeScript": {
      "format_on_save": "on",
      "tab_size": 2
    },
    "Rust": {
      "format_on_save": "on",
      "hard_tabs": false
    },
    "Python": {
      "tab_size": 4
    }
  }
}

CLI Commands

Basic commands

# Open file
zed file.txt

# Open directory
zed /path/to/project

# Wait for editor to close
zed --wait file.txt

# Add to existing window
zed --add file.txt

Advanced usage

# Open at line number
zed file.txt:42

# Open multiple files
zed file1.txt file2.txt

# Open with specific workspace
zed --workspace name .

# Diff two files
zed --diff file1.txt file2.txt

Keyboard Shortcuts (Windows/Linux)

Essential shortcuts

Shortcut Action
Ctrl+P Go to file
Ctrl+Shift+P Command palette
Ctrl+T Go to symbol
Ctrl+G Go to line
Ctrl+D Add next occurrence
Ctrl+/ Toggle comment

Window & tabs

Shortcut Action
Ctrl+W Close tab
Ctrl+Shift+T Reopen tab
Ctrl+Tab Next tab
Ctrl+Shift+Tab Previous tab
Ctrl+\ Split editor

Editing

Shortcut Action
Ctrl+Shift+K Delete line
Alt+↑/↓ Move line
Ctrl+Enter Insert line below
Ctrl+Shift+Enter Insert line above
F2 Rename symbol

Performance

Optimization tips

{
  // Disable telemetry
  "telemetry": {
    "metrics": false,
    "diagnostics": false
  },

  // Reduce indexing
  "file_scan_exclusions": [
    "**/.git",
    "**/node_modules",
    "**/target",
    "**/.next"
  ],

  // Limit LSP memory
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "cargo": {
          "loadOutDirsFromCheck": false
        }
      }
    }
  }
}

Performance monitoring

# Check performance
Cmd+Shift+P > "Diagnostics: Show"

# View CPU usage
Activity Monitor (macOS)
Task Manager (Windows)

# Clear cache
rm -rf ~/.config/zed/cache

Troubleshooting

Common issues

# LSP not working
1. Check language server installed
2. Restart LSP: Cmd+Shift+P > "LSP: Restart"
3. Check logs: Cmd+Shift+P > "Logs: Open"

# Extensions not loading
1. Check extension compatibility
2. Disable conflicting extensions
3. Restart Zed

# Performance issues
1. Disable unused extensions
2. Reduce file scan scope
3. Check system resources

Reset configuration

# Backup settings
cp ~/.config/zed/settings.json ~/zed-settings-backup.json

# Reset to defaults
rm -rf ~/.config/zed

# Restart Zed to regenerate

Gotchas

Common pitfalls

⚠️ Vim mode conflicts: Some key bindings may conflict with Vim mode. Check keymap.json

⚠️ LSP installation: Language servers must be installed separately (rust-analyzer, typescript-language-server)

⚠️ Format on save: May conflict with linters if both modify code. Use one or the other

⚠️ Extensions API: Still evolving, some extensions may break between versions

⚠️ Multiplayer privacy: Shared sessions expose your workspace. Be careful with sensitive data

⚠️ Git integration: Requires Git installed and accessible in PATH

Themes

Popular themes

{
  "theme": "One Dark"
  // Alternatives:
  // "Ayu Dark"
  // "Ayu Light"
  // "Ayu Mirage"
  // "Gruvbox Dark"
  // "Solarized Dark"
  // "Solarized Light"
  // "GitHub Dark"
  // "GitHub Light"
}

Custom theme

{
  "experimental.theme_overrides": {
    "background": "#1e1e1e",
    "foreground": "#d4d4d4",
    "editor.background": "#1e1e1e",
    "editor.foreground": "#d4d4d4"
  }
}

Also see

Zed Cheatsheet - NexusCS