Keybindings
Keyboard shortcuts and key customization in Zed.
Base Keymaps
Zed supports different base keymaps:
{
"base_keymap": "VSCode"
}
Options:
VSCode - VS Code-like keybindings JetBrains - JetBrains IDE keybindings Sublime Text - Sublime Text keybindings Atom - Atom editor keybindings TextMate - TextMate keybindings
Essential Shortcuts
File Operations
| Key | Action |
| Cmd+P | Quick open file |
| Cmd+Shift+P | Command palette |
| Cmd+N | New file |
| Cmd+S | Save |
| Cmd+Shift+S | Save as |
| Cmd+W | Close tab |
| Cmd+Shift+W | Close window |
Navigation
| Key | Action |
| Cmd+G | Go to line |
| Cmd+Shift+O | Go to symbol |
| Ctrl+- | Go back |
| Ctrl+Shift+- | Go forward |
| Cmd+Shift+E | Focus file explorer |
| Cmd+B | Toggle sidebar |
Search
| Key | Action |
| Cmd+F | Find in file |
| Cmd+Shift+F | Find in project |
| Cmd+H | Find and replace |
| Cmd+Shift+H | Replace in project |
| F3 / Shift+F3 | Find next/previous |
| Cmd+D | Select next occurrence |
| Cmd+Shift+L | Select all occurrences |
Editing
| Key | Action |
| Cmd+X | Cut line (no selection) |
| Cmd+C | Copy line (no selection) |
| Cmd+Shift+K | Delete line |
| Cmd+Enter | Insert line below |
| Cmd+Shift+Enter | Insert line above |
| Alt+Up / Alt+Down | Move line up/down |
| Alt+Shift+Up / Alt+Shift+Down | Copy line up/down |
| Cmd+/ | Toggle line comment |
| Cmd+Shift+/ | Toggle block comment |
Multi-Cursor
| Key | Action |
| Cmd+D | Add selection to next match |
| Cmd+Shift+L | Select all matches |
| ++alt+click++ | Add cursor |
| Cmd+Alt+Up / Cmd+Alt+Down | Add cursor above/below |
| Esc | Exit multi-cursor |
Code
| Key | Action |
| F12 | Go to definition |
| Alt+F12 | Peek definition |
| Shift+F12 | Find references |
| F2 | Rename symbol |
| Cmd+. | Quick fix / code action |
| Shift+Alt+F | Format document |
| Cmd+K+Cmd+F | Format selection |
View
| Key | Action |
| Cmd++ / Cmd+- | Zoom in/out |
| Cmd+0 | Reset zoom |
| Cmd+\ | Split editor right |
| Cmd+K+Cmd+\ | Split editor down |
| Cmd+1 / Cmd+2 / Cmd+3 | Focus editor group |
| ++ctrl+backtick++ | Toggle terminal |
Panels
| Key | Action |
| Cmd+B | Toggle primary sidebar |
| Cmd+Shift+E | Show explorer |
| Cmd+Shift+F | Show search |
| Cmd+Shift+G | Show git |
| Cmd+Shift+X | Show extensions |
Vim Mode
Enable vim mode:
Vim Mode Settings
{
"vim": {
"use_system_clipboard": "always",
"use_multiline_find": true,
"use_smartcase_find": true
}
}
Vim Keybindings
Standard vim motions work:
| Key | Action |
h j k l | Movement |
w b e | Word movement |
0 $ ^ | Line movement |
gg G | File start/end |
{ } | Paragraph movement |
% | Matching bracket |
Editing:
| Key | Action |
i a | Insert mode |
o O | Open line below/above |
d | Delete |
c | Change |
y | Yank |
p P | Paste after/before |
u | Undo |
| Ctrl+R | Redo |
. | Repeat |
Visual mode:
| Key | Action |
v | Visual mode |
V | Visual line |
| Ctrl+V | Visual block |
Text objects:
| Key | Action |
iw aw | Inner/around word |
i" a" | Inner/around quotes |
i( a( | Inner/around parens |
i{ a{ | Inner/around braces |
Vim Commands
| Command | Action |
:w | Save |
:q | Quit |
:wq | Save and quit |
:e <file> | Edit file |
:<number> | Go to line |
:%s/old/new/g | Replace all |
Custom Keybindings
Create ~/.config/zed/keymap.json:
[
{
"context": "Editor",
"bindings": {
"ctrl+s": "workspace::Save",
"ctrl+shift+s": "workspace::SaveAs"
}
}
]
Binding Structure
{
"context": "Editor",
"bindings": {
"key combination": "action::Name"
}
}
Contexts
| Context | Description |
Editor | Text editor |
Workspace | Main workspace |
Pane | Editor pane |
Terminal | Terminal panel |
ProjectPanel | File explorer |
vim_mode == normal | Vim normal mode |
vim_mode == insert | Vim insert mode |
vim_mode == visual | Vim visual mode |
Common Actions
[
{
"context": "Editor",
"bindings": {
"ctrl+shift+k": "editor::DeleteLine",
"ctrl+shift+d": "editor::DuplicateLine",
"ctrl+j": "editor::MoveLineDown",
"ctrl+k": "editor::MoveLineUp",
"ctrl+/": "editor::ToggleComments"
}
}
]
Vim-Specific Bindings
[
{
"context": "Editor && vim_mode == normal",
"bindings": {
"space f f": "file_finder::Toggle",
"space f g": "workspace::NewSearch",
"space e": "project_panel::ToggleFocus",
"space g g": "terminal_panel::ToggleFocus"
}
}
]
Remove Default Binding
[
{
"context": "Editor",
"bindings": {
"ctrl+k": null
}
}
]
Chord Sequences
[
{
"context": "Editor",
"bindings": {
"ctrl+k ctrl+c": "editor::ToggleComments",
"ctrl+k ctrl+u": "editor::UncommentLines"
}
}
]
Finding Actions
Use the Command Palette (Cmd+Shift+P) to find action names.
Or check the default keybindings:
# View default keybindings
open ~/.config/zed/default-keymap.json
Keybinding Examples
Vim Leader Key
[
{
"context": "Editor && vim_mode == normal",
"bindings": {
"space space": "file_finder::Toggle",
"space /": "workspace::NewSearch",
"space ,": "pane::AlternateFile",
"space e": "project_panel::ToggleFocus",
"space w": "workspace::Save",
"space q": "pane::CloseActiveItem",
"space b d": "pane::CloseActiveItem",
"space c a": "editor::ToggleCodeActions",
"space c r": "editor::Rename"
}
}
]
Window Management
[
{
"context": "Pane",
"bindings": {
"ctrl+h": ["workspace::ActivatePaneInDirection", "Left"],
"ctrl+l": ["workspace::ActivatePaneInDirection", "Right"],
"ctrl+k": ["workspace::ActivatePaneInDirection", "Up"],
"ctrl+j": ["workspace::ActivatePaneInDirection", "Down"]
}
}
]
Terminal
[
{
"context": "Terminal",
"bindings": {
"ctrl+shift+c": "terminal::Copy",
"ctrl+shift+v": "terminal::Paste",
"ctrl+shift+n": "terminal::NewTerminal"
}
}
]
Troubleshooting
Key Not Working
- Check for conflicts in Command Palette
- Verify context is correct
- Check action name is valid
Find Conflicting Bindings
# Search keybindings
grep -r "ctrl+k" ~/.config/zed/keymap.json
Reset to Defaults
rm ~/.config/zed/keymap.json