Zed: Vim Mode Cheatsheet
Essential Vim keybindings and workflows for Zed editor on Linux.
Enabling Vim Mode
Add to ~/.config/zed/settings.json:
json
{
"vim_mode": true
}Or toggle via command palette: Ctrl+Shift+P → "Toggle Vim Mode".
Modes
| Key | Action |
|---|---|
Esc | Return to Normal mode |
i | Insert before cursor |
a | Insert after cursor |
I | Insert at beginning of line |
A | Insert at end of line |
o | Open new line below |
O | Open new line above |
v | Visual (character) mode |
V | Visual Line mode |
Ctrl+V | Visual Block mode |
Basic Motions
| Key | Action |
|---|---|
h / l | Move left / right |
j / k | Move down / up |
w | Jump to next word start |
b | Jump to previous word start |
e | Jump to end of word |
0 | Jump to beginning of line |
$ | Jump to end of line |
^ | Jump to first non-blank character |
gg | Jump to top of file |
G | Jump to bottom of file |
{ / } | Jump to previous / next paragraph |
Ctrl+D | Scroll half page down |
Ctrl+U | Scroll half page up |
% | Jump to matching bracket |
:<number> | Go to line number |
Editing
| Key | Action |
|---|---|
x | Delete character under cursor |
dd | Delete entire line |
dw | Delete word |
d$ or D | Delete to end of line |
cc | Change entire line |
cw | Change word |
c$ or C | Change to end of line |
yy | Yank (copy) line |
yw | Yank word |
p | Paste after cursor |
P | Paste before cursor |
u | Undo |
Ctrl+R | Redo |
. | Repeat last change |
>> / << | Indent / unindent line |
~ | Toggle case |
Search & Replace (In-Editor)
| Key | Action |
|---|---|
/pattern | Search forward |
?pattern | Search backward |
n | Next match |
N | Previous match |
* | Search word under cursor (forward) |
# | Search word under cursor (backward) |
Text Objects
Use with operators like d, c, y (e.g., di" deletes inside quotes).
| Key | Action |
|---|---|
iw / aw | Inner word / a word (with space) |
i" / a" | Inside double quotes / around quotes |
i' / a' | Inside single quotes / around quotes |
i( / a( | Inside parentheses / around parens |
i{ / a{ | Inside braces / around braces |
i[ / a[ | Inside brackets / around brackets |
it / at | Inside HTML tag / around tag |
Surround (Built-in)
Zed includes vim-surround support out of the box.
| Key | Action |
|---|---|
ys<motion><char> | Add surround (e.g., ysiw" surrounds word with quotes) |
ds<char> | Delete surround (e.g., ds" removes surrounding quotes) |
cs<old><new> | Change surround (e.g., cs"' changes " to ') |
File Search & Navigation
| Key | Action |
|---|---|
Ctrl+P | Open file finder (fuzzy search by filename) |
Ctrl+Shift+F | Search across entire project (grep) |
Ctrl+Shift+P | Command palette |
Ctrl+G | Go to line |
Ctrl+Shift+O | Go to symbol in file |
gd | Go to definition (Vim motion) |
gr | Go to references |
Ctrl+Shift+E | Focus file explorer / project panel |
Ctrl+- | Navigate back |
Ctrl+Shift+- | Navigate forward |
Project Panel (File Explorer)
Toggle with Ctrl+Shift+E or click the file icon in the sidebar.
| Key | Action |
|---|---|
j / k | Move down / up in file list |
Enter | Open file or expand folder |
a | Add new file |
A | Add new directory |
r | Rename file or folder |
d | Delete file or folder |
Ctrl+Shift+E | Toggle project panel focus |
Terminal
| Key | Action |
|---|---|
Ctrl+` | Toggle terminal panel |
Ctrl+Shift+` | Open new terminal |
Ctrl+Shift+E | Focus back to editor from terminal |
Ctrl+` | Focus back to terminal from editor |
When the terminal is focused, normal typing goes to the shell. Press Ctrl+` to switch back to the editor.
Splits & Panes
| Key | Action |
|---|---|
Ctrl+\ | Split editor right |
Ctrl+K then Ctrl+\ | Split editor down |
Ctrl+K then Ctrl+Left | Focus pane to the left |
Ctrl+K then Ctrl+Right | Focus pane to the right |
Ctrl+K then Ctrl+Up | Focus pane above |
Ctrl+K then Ctrl+Down | Focus pane below |
Ctrl+W then Ctrl+W | Cycle through panes |
Tabs
| Key | Action |
|---|---|
Ctrl+Tab | Next tab |
Ctrl+Shift+Tab | Previous tab |
Ctrl+W | Close current tab |
Ctrl+1 to Ctrl+9 | Switch to tab by number |
Ctrl+Shift+T | Reopen last closed tab |
gt | Next tab (Vim) |
gT | Previous tab (Vim) |
Multi-Cursor
| Key | Action |
|---|---|
Ctrl+D | Select next occurrence of word (add cursor) |
Ctrl+Shift+L | Select all occurrences of word |
gb | Add cursor at next occurrence (Vim) |
Ctrl+Alt+Up | Add cursor above |
Ctrl+Alt+Down | Add cursor below |
Useful Combos
| Action | Keys |
|---|---|
| Delete a word and type replacement | ciw then type new word |
| Delete inside quotes and retype | ci" then type new text |
| Select a function body and delete | vi{d |
| Indent a block | V select lines, then > |
| Comment/uncomment lines | gcc (single line) or gc in visual mode |
| Duplicate line | yyp |
| Move line down | ddp |
| Move line up | ddkP |
| Search and open a file | Ctrl+P, type filename, Enter |
| Jump to definition and come back | gd to go, Ctrl+- to come back |