You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zed's Vim mode replicates familiar Vim behavior while integrating modern features like semantic navigation and multiple cursors. This cheat sheet summarizes essential shortcuts and settings to help you navigate and edit code efficiently in Zed.
Enabling/Disabling Vim Mode
Enable/Disable Vim Mode: Open the command palette and use Toggle Vim Mode.
This updates your user settings: "vim_mode": true or false.
Zed-Specific Features
Language Server Commands
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 of current word
g A
Find symbol in current file
g s
Find symbol in entire project
g S
Go to next diagnostic
g ] or ] d
Go to previous diagnostic
g [ or [ d
Show inline error (hover)
g h
Open code actions menu
g .
Git Commands
Command
Shortcut
Go to next Git change
] c
Go to previous Git change
[ c
Tree-Sitter Commands
Command
Shortcut
Select a smaller syntax node
] x
Select a larger syntax node
[ x
Multi-Cursor Commands
Command
Shortcut
Add cursor at next occurrence of word
g l
Add cursor at previous occurrence of word
g L
Skip latest selection and add next occurrence
g >
Skip latest selection and add previous
g <
Select all occurrences of the current word
g a
Pane Management
Command
Shortcut
Open project-wide search
g /
Open current search excerpt
g <space>
Open search excerpt in a split
<ctrl-w> <space>
Go to definition in a split
<ctrl-w> g d
Go to type definition in a split
<ctrl-w> g D
Insert Mode Shortcuts
Command
Shortcut
Open completion menu
ctrl-x ctrl-o
Request 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
Supported Plugins Features
Surround Text Objects:
Yank surround: ys
Change surround: cs
Delete surround: ds
Commenting:
Comment/uncomment selection in visual mode: gc
Comment/uncomment current line in normal mode: gcc
Project Panel Shortcuts (Netrw-like):
Navigate: h, j, k, l
Open file: o
Open file in new tab: t
Command Palette Shortcuts
Access the command palette with : in Vim mode. Common Vim commands and aliases are supported.
File and Window Management
Command
Description
:w[rite][!]
Save current file
:wq[!]
Save file and close buffer
:q[uit][!]
Close buffer
:wa[ll][!]
Save all open files
:wqa[ll][!]
Save all files and close all buffers
:qa[ll][!]
Close all buffers
:[e]x[it][!]
Close buffer
:up[date]
Save current file
:cq
Quit Zed completely
:vs[plit]
Split pane vertically
:sp[lit]
Split pane horizontally
:new
New file in horizontal split
:vne[w]
New file in vertical split
:tabedit
New file in new tab
:tabnew
New file in new tab
:tabn[ext]
Go to next tab
:tabp[rev]
Go to previous tab
:tabc[lose]
Close current tab
Note: Append ! to force execution without prompts.
Ex Commands
Command
Description
:E[xplore]
Open project panel
:C[ollab]
Open collaboration panel
:Ch[at]
Open chat panel
:A[I]
Open AI panel
:No[tif]
Open notifications panel
:fe[edback]
Open feedback window
:cl[ist]
Open diagnostics window
:te[rm]
Open terminal
:Ext[ensions]
Open extensions window
Navigating Diagnostics
Command
Description
:cn[ext] or :ln[ext]
Go to next diagnostic
:cp[rev] or :lp[rev]
Go to previous diagnostic
:cc or :ll
Open errors page
Git Commands
Command
Description
:dif[fupdate]
View diff under cursor (d o in normal mode)
:rev[ert]
Revert diff under cursor (d p in normal mode)
Jump Commands
Command
Description
:<number>
Jump to specified line number
:$
Jump to end of file
:/foo
Jump to next line matching foo
:?foo
Jump to previous line matching foo
Replacement Commands
Command
Description
:[range]s/foo/bar/
Replace foo with bar in [range]
Editing Commands
Command
Description
:j[oin]
Join current line with next
:d[elete][l][p]
Delete current line
:s[ort] [i]
Sort selection (case-insensitive with i)
:y[ank]
Yank (copy) selection or line
Command Mnemonics
Use mnemonics in the command palette for quick access:
:diffs – Toggle all diffs
:cpp – Copy file path
:crp – Copy relative path
:reveal – Reveal in Finder
:zlog – Open Zed log
:clank – Cancel language server work
Customizing Key Bindings
Useful Contexts
Normal & Visual Mode: VimControl && !menu
Normal Mode Only: vim_mode == normal && !menu
Insert Mode: vim_mode == insert
Empty Pane or Shared Screen: EmptyPane || SharedScreen
Examples
Remap Shift-Y to Yank to End of Line:
{
"context": "vim_mode == normal && !menu",
"bindings": {
"shift-y": ["workspace::SendKeystrokes", "y $"]
}
}
{
"context": "Editor && !menu",
"bindings": {
"ctrl-c": "editor::Copy", // Vim default: return to normal mode"ctrl-x": "editor::Cut", // Vim default: decrement"ctrl-v": "editor::Paste", // Vim default: visual block mode"ctrl-y": "editor::Undo", // Vim default: line up"ctrl-f": "buffer_search::Deploy", // Vim default: page down"ctrl-o": "workspace::Open", // Vim default: go back"ctrl-a": "editor::SelectAll"// Vim default: increment
}
}
Changing Vim Mode Settings
Modify Vim mode behavior by updating your user settings.
Available Settings
Property
Description
Default Value
use_system_clipboard
Clipboard usage: "always", "never", or "on_yank"
"always"
use_multiline_find
If true, f and t motions cross lines
false
use_smartcase_find
If true, f and t are case-insensitive with lowercase targets
false
toggle_relative_line_numbers
Line numbers relative in normal mode, absolute in insert mode
When I paste yanked lines with "y" in a Ruby code file, Zed inserts 2 extra spaces in lines after my "def methodname" line. Any ideas how to prevent this?
Is there a keybind to open the "Search project files" search in Vim mode? This would be a great replacement for Neovim's Telescope plugin.