Keyboard Shortcuts

Master Zed's keyboard shortcuts to boost productivity

Introduction to Zed Shortcuts

Keyboard shortcuts are at the heart of an efficient workflow in Zed. By learning and mastering these shortcuts, you can dramatically increase your productivity by reducing the time spent on repetitive actions and navigation.

Zed offers several shortcut presets to match your experience with other editors:

  • Default: Zed's native keyboard shortcuts
  • VS Code: Shortcuts similar to Visual Studio Code
  • Sublime Text: Shortcuts matching Sublime Text
  • Vim: Vim-style modal editing

This tutorial focuses on Zed's default keyboard shortcuts. If you're using a different preset, some shortcuts may vary. You can view your current keybindings in Settings.

Customizing Keyboard Shortcuts

Zed allows you to customize keyboard shortcuts to match your preferences and workflow.

Changing Keyboard Preset

Switch between predefined keyboard shortcut schemes:

  1. Open Settings

    Press , to open the Settings panel.

  2. Navigate to Keybindings

    Search for "keybindings" or navigate to the Keybindings section.

  3. Select Preset

    Choose from available presets (Default, VS Code, Sublime, Vim).

    Keyboard Preset Selection

Custom Keybindings

Create your own custom keyboard shortcuts:

  1. Open Keybindings File

    Press P, type "Preferences: Open Keyboard Shortcuts" and select it.

  2. Add Custom Bindings

    Add your custom keybindings in the JSON format. Each binding needs a command and a key combination.

Example of Custom Keybindings

json
[ { "key": "cmd+k cmd+m", "command": "workbench.action.toggleMaximizedPanel" }, { "key": "alt+cmd+e", "command": "workbench.view.explorer" }, { "key": "cmd+shift+j", "command": "editor.action.joinLines" } ]

If you're coming from another editor, you can gradually customize Zed's shortcuts to match your muscle memory from the previous editor.

Keyboard Shortcut Reference Card

For quick reference, here is a printable card with the most essential Zed shortcuts:

Essential Shortcuts Reference

Category Action Shortcut
General Open File P
Command Palette P
Save File S
Settings ,
Editing Multiple Cursors D or + Click
Move Line /
Delete Line K
Comment Code /
Navigation Find in File F
Find in Project F
Go to Symbol O

What's Next?

Congratulations! You've completed the Zed 101 tutorial series and learned about all the core features of the Zed editor. With knowledge of its interface, editing capabilities, collaboration features, and keyboard shortcuts, you're well-equipped to be productive with Zed.

We recommend:

  • Practicing the keyboard shortcuts daily to build muscle memory
  • Exploring the Zed extension marketplace to enhance your setup
  • Joining the Zed community on Discord to learn from other users
  • Contributing to Zed's development on GitHub if you're interested

Shortcut Notation

Throughout this guide, we'll use the following notation for keyboard shortcuts:

For example, P means "press the Command key and P simultaneously" on macOS or "press the Control key and P simultaneously" on Windows/Linux.

Essential Shortcuts

These are the most fundamental shortcuts that every Zed user should know:

Consider printing this section as a quick reference until these shortcuts become muscle memory.

General

Shortcut Action
P Open file picker (fuzzy find)
P Open command palette
S Save current file
W Close current tab
, Open settings

Editing

Shortcut Action
X Cut (line if no selection)
C Copy (line if no selection)
V Paste
Z Undo
Z Redo

Navigation

Shortcut Action
F Find in file
F Find in project
G Go to line
[ / ] Navigate between tabs

Editor Navigation Shortcuts

These shortcuts help you move around efficiently within files and the editor.

Cursor Movement

Shortcut Action
/ Move cursor by word
/ Move to line start/end
/ Move to document start/end
Page Up / Page Down Scroll page up/down

File Navigation

Shortcut Action
P Quick open file
O Go to symbol in file
O Go to symbol in project
1 - 9 Go to tab 1-9
[ / ] Navigate back/forward

Use P followed by typing a filename to quickly jump to any file in your project. The fuzzy finder is smart enough to match partial names and acronyms.

Text Editing Shortcuts

These shortcuts help you edit and manipulate text quickly.

Selection

Shortcut Action
A Select all
L Select current line
D Select next occurrence of selection
L Select all occurrences of selection
/ Expand/shrink selection

Editing Operations

Shortcut Action
/ Add cursor above/below
K Delete line
D Duplicate line or selection
/ Move line up/down
/ Toggle line comment
Tab / Tab Indent/outdent line or selection

Code Folding

Shortcut Action
[ Fold region
] Unfold region
K 0 Fold all regions
K J Unfold all regions

Interface Shortcuts

These shortcuts help you control Zed's interface components.

Panels and Views

Shortcut Action
B Toggle sidebar
` Toggle terminal
\\ Split editor vertically
\\ Split editor horizontally
E Show explorer view
G Show Git view

View Management

Shortcut Action
+ / - Zoom in/out
0 Reset zoom
1 Single editor layout
2 Split editor layout
K Z Zen mode

Zen mode removes all distractions and focuses solely on the editor. It's perfect for deep concentration.

Feature-Specific Shortcuts

These shortcuts are specific to certain Zed features.

Search and Replace

Shortcut Action
F Find in current file
F Replace in current file
F Find in all files
H Replace in all files
F3 / F3 Find next/previous

Terminal

Shortcut Action
` Toggle terminal panel
T New terminal
K Clear terminal
/ Scroll terminal history

Git Integration

Shortcut Action
G Show Git panel
S Stage changes
Z Discard changes
C Commit staged changes
B Show current branch

Collaboration

Shortcut Action
C Open chat
P then "Follow" Follow collaborator
P then "Invite" Invite collaborator