Terminal GuideTerminal Guide
zed icon

Zed

Text Editors
macOSLinux
Rust

High-performance code editor with real-time collaboration.

Official Website

Features

Ultra FastReal-time CollaborationAI AssistantBuilt-in TerminalTree-sitter

Installation

Homebrew
brew install --cask zed

Why Use Zed?

Zed is a next-generation code editor built by the creators of Atom and Tree-sitter. Written in Rust, it's characterized by incredible speed and real-time collaboration features.

Lightning Fast

Written in Rust with GPU rendering. Startup, scrolling, and searching are blazingly fast.

Real-time Collaboration

Edit simultaneously like Google Docs. Share screen, voice calls, and cursor positions.

AI Assistant

Integrated with Claude, GPT-4, Gemini. Code generation, refactoring, and Q&A within the editor.

Built-in Terminal

Fast integrated terminal. Run commands, build, and test without leaving the editor.

Installation

Installation
# macOS (Homebrew)
brew install --cask zed

# macOS (from official site)
# Download from https://zed.dev/download

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

# Linux (Flatpak)
flatpak install flathub dev.zed.Zed

# Check version (after launching GUI)
# Zed > About Zed

# Install CLI tools
# Zed > Install CLI

Basic Operations

CLI Operations
# Open a file
zed filename.txt

# Open directory (project)
zed .
zed ~/projects/myapp

# Open multiple files
zed file1.txt file2.txt

# Open and jump to line
zed filename.txt:10

# Open in new window
zed -n filename.txt

# Add new project to existing window
zed -a ~/another-project

Frequently Used Keyboard Shortcuts

File Operations

KeyDescription
Cmd+PQuick open file
Cmd+Shift+PCommand palette
Cmd+SSave file
Cmd+WClose tab
Cmd+Shift+EToggle project panel
Cmd+BToggle sidebar

Editing

KeyDescription
Cmd+DAdd next same word to selection
Cmd+Shift+LSelect all matching words
Alt+ClickAdd multi-cursor
Cmd+Shift+KDelete line
Alt+Up/DownMove line up/down
Cmd+/Toggle line comment
Cmd+Shift+DDuplicate line
Cmd+EnterInsert new line below

Navigation

KeyDescription
Cmd+GJump to line number
Cmd+Shift+OJump to symbol
F12 / Cmd+ClickJump to definition
Shift+F12Find references
Ctrl+-Go to previous location
Cmd+Shift+FSearch entire project

Panels and Terminal

KeyDescription
Ctrl+`Toggle terminal
Cmd+Shift+TNew terminal tab
Cmd+\Split editor
Cmd+1/2/3Switch to corresponding tab

Configuration

Zed configuration is stored in ~/.config/zed/settings.json. Open it with Cmd+,.

~/.config/zed/settings.json
{
  // Theme settings
  "theme": "One Dark",
  "buffer_font_family": "JetBrains Mono",
  "buffer_font_size": 14,
  "ui_font_size": 14,

  // Editor settings
  "tab_size": 2,
  "soft_wrap": "editor_width",
  "show_whitespaces": "selection",
  "relative_line_numbers": true,

  // Format
  "format_on_save": "on",
  "formatter": "language_server",

  // Auto-save
  "autosave": {
    "after_delay": {
      "milliseconds": 1000
    }
  },

  // File scan exclusions
  "file_scan_exclusions": [
    "**/node_modules",
    "**/.git",
    "**/target",
    "**/dist"
  ],

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

  // Enable Vim mode
  "vim_mode": true,

  // Terminal settings
  "terminal": {
    "font_family": "JetBrains Mono",
    "font_size": 13,
    "shell": {
      "program": "/bin/zsh"
    }
  },

  // AI assistant settings
  "assistant": {
    "default_model": {
      "provider": "anthropic",
      "model": "claude-3-5-sonnet-20241022"
    },
    "version": "2"
  },

  // Inline completions
  "show_inline_completions": true,

  // Git settings
  "git": {
    "inline_blame": {
      "enabled": true
    }
  },

  // Language-specific settings
  "languages": {
    "TypeScript": {
      "tab_size": 2,
      "formatter": "prettier"
    },
    "Python": {
      "tab_size": 4,
      "formatter": {
        "external": {
          "command": "black",
          "arguments": ["-"]
        }
      }
    }
  }
}

Keymap Configuration

Customize keybindings in ~/.config/zed/keymap.json.

~/.config/zed/keymap.json
[
  {
    "context": "Editor",
    "bindings": {
      // Custom keybindings
      "ctrl-s": "workspace::Save",
      "ctrl-shift-s": "workspace::SaveAll",

      // VS Code-style keybindings
      "ctrl-shift-k": "editor::DeleteLine",
      "alt-up": "editor::MoveLineUp",
      "alt-down": "editor::MoveLineDown",

      // Duplicate line
      "ctrl-shift-d": "editor::DuplicateLine"
    }
  },
  {
    "context": "Workspace",
    "bindings": {
      // Toggle sidebar
      "ctrl-b": "workspace::ToggleLeftDock",
      // Terminal
      "ctrl-`": "terminal_panel::ToggleFocus"
    }
  },
  {
    // Custom bindings for Vim mode
    "context": "vim_mode == normal",
    "bindings": {
      "space f f": "file_finder::Toggle",
      "space f g": "workspace::NewSearch",
      "space e": "project_panel::ToggleFocus"
    }
  }
]

Collaboration Features

Use Zed's real-time collaboration to edit simultaneously with team members.

Collaboration
# How to Use Collaboration

1. Sign In with Zed Account
   - Zed > Sign In with GitHub account

2. Share Project
   - Run "Share Project" from Cmd+Shift+P
   - Link copied to clipboard

3. Join Shared Project
   - Click the shared link
   - Or use Cmd+Shift+P "Join Call"

# Collaboration Features
- Real-time cursor position display for other users
- Shared selections
- Voice calling available
- Screen sharing

# Collaboration Shortcuts
Cmd+Alt+M    : Toggle mute
Cmd+Alt+S    : Start/stop screen share
Cmd+Alt+F    : Follow participant

AI Assistant

Zed has a built-in AI assistant for code generation and refactoring.

AI Assistant
# How to Use AI Assistant

1. Open Assistant Panel
   Cmd+? or Cmd+Shift+P → "assistant: new context"

2. Inline Assist (for selected code)
   - Select code
   - Press Cmd+Enter to activate inline assist
   - Enter your prompt

3. Common Prompt Examples
   - "Explain this function"
   - "Refactor this code"
   - "Add error handling"
   - "Write a test for this"
   - "Add TypeScript types"

# Specify API Key in Settings
# settings.json
{
  "assistant": {
    "default_model": {
      "provider": "anthropic",  // or "openai"
      "model": "claude-3-5-sonnet-20241022"
    }
  }
}

# Set Anthropic API Key
# Zed > Settings > Anthropic API Key

Extensions

Zed keeps the extension system simple to maintain performance. Open the extensions panel with Cmd+Shift+X.

Extensions
# Install Extensions
1. Open extensions panel with Cmd+Shift+X
2. Search and click "Install"

# Popular Extensions
- html         : HTML language support
- emmet        : Emmet expansion
- dockerfile   : Dockerfile support
- prisma       : Prisma ORM support
- astro        : Astro framework support
- svelte       : Svelte support
- vue          : Vue.js support
- tailwindcss  : Tailwind CSS IntelliSense
- sql          : SQL support

# Manage Extensions
:extension list         # List installed
:extension install xxx  # Install
:extension uninstall xxx # Uninstall

Tips

  • Enable vim_mode for Vim keybindings. Runs smoother than VS Code.
  • Use Cmd+K Cmd+S to view keyboard shortcuts. Great for customization reference.
  • During collaboration, use Cmd+Alt+F to follow other users. Perfect for pair programming.
  • The AI assistant activates inline with Cmd+Enter. Get edit suggestions directly for selected code.
  • Enable format_on_save for automatic formatting on save. Prettier integration works smoothly.
  • Zed is actively developed with weekly updates. Keep it updated regularly.
  • Migrating from VS Code is easy. Keybindings are similar and LSP settings are recognized automatically.
Written by Dai AokiPublished: 2026-01-20

Related Articles

Explore More