Zed Vim Mode Cheatsheet

Core Differences from Vim

  • Motions: Language-specific behavior (e.g., % matches | in Rust)
  • Visual Blocks: Uses multiple cursors for real-time updates
  • Macros: Records complex actions including autocompletion
  • Search/Replace: Different regex syntax (() vs \(\), $ vs \)

Language Server Navigation

Command Shortcut
Go to definition g d
Go to declaration g D
Go to type definition g y
Go to implementation g I
Rename (change definition) c d
Go to all references g A
Find symbol in current file g s
Find symbol in project g S
Go to next/prev diagnostic g ] / g [
Show inline error (hover) g h
Open code actions menu g .

Git Integration

Command Shortcut
Go to next/prev git change ] c / [ c
Expand diff hunk d o
Toggle staged d O
Stage/Unstage and next d u / d U
Restore change d p

Insert Mode Commands

Command Shortcut
Open completion menu ctrl-x ctrl-o
GitHub Copilot suggestion ctrl-x ctrl-c
Open inline AI assistant ctrl-x ctrl-a
Open code actions menu ctrl-x ctrl-l
Hide all suggestions ctrl-x ctrl-z

Treesitter Navigation

Command Shortcut
Next/previous method ] m / [ m
Next/previous method end ] M / [ M
Next/previous section ] ] / [ [
Next/previous section end ] [ / [ ]
Next/previous comment ] / / [ /
Select larger syntax node [ x
Select smaller syntax node ] x

Treesitter Text Objects

Text Object Shortcut
Around/inside class a c / i c
Around/inside function a f / i f
A comment g c
Inside/around argument i a / a a
Around/inside HTML tag a t / i t
Indent level + line before/after a I
Indent level + line before a i
Current indent level i i

Multi-cursor Management

Command Shortcut
Add cursor at next word match g l
Add cursor at previous word match g L
Skip & add next/previous g > / g <
Add selection for every word match g a

Pane Management

Command Shortcut
Open project-wide search g /
Open current search excerpt g <space>
Open search excerpt in split <ctrl-w> <space>
Go to definition in split <ctrl-w> g d
Go to type definition in split <ctrl-w> g D

Built-in Plugin Features

Command Mode Shortcut
Surround text object Normal ys + motion
Change surrounding Normal cs + old + new
Delete surrounding Normal ds + target
Comment/uncomment line Normal gcc
Comment/uncomment selection Visual gc
Replace with register Normal gr + motion
Exchange text Normal cx + motion + cx + motion

Command Palette (Ex Commands)

Command Action
:w[rite][!] Save current file
:wq[!] Save and close buffer
:q[uit][!] Close buffer
:E[xplore] Open project panel
:vs[plit] / :sp[lit] Split pane vertically/horizontally
:tabnew Create new file in new tab
:tabn[ext] / :tabp[rev] Go to next/previous tab
:[range]s/foo/bar/ Replace text
:j[oin] Join current line
:s[ort] [i] Sort selection

Optional Features

Feature Description
Subword motion Navigate camelCase/snake_case
Sneak motion Jump to character pairs
Visual mode surround Surround selection
Wrapping cursor Cursor wraps at line ends

Settings Customization

Setting Description Default
vim.default_mode Default mode to start in "normal"
vim.use_system_clipboard System clipboard usage "always"
vim.use_multiline_find Multi-line f/t motions false
vim.use_smartcase_find Case-insensitive f/t false
vim.toggle_relative_line_numbers Toggle line numbers by mode false
vim.highlight_on_yank_duration Yank highlight duration (ms) 200