Zed Vim Key Mappings: Surrounds

2026-01-29T00:00:00.000Z

Zed’s Vim mode includes a powerful “surround” feature, similar to the popular vim-surround plugin. This allows you to easily add, change, and delete surrounding characters like parentheses, brackets, quotes, and HTML tags.

The primary commands are:

  • y s (Yank Surround): Add surrounds to a text object.
  • d s (Delete Surround): Delete a surrounding pair.
  • c s (Change Surround): Change one surrounding pair for another.

Examples

CommandActionBeforeAfter
ysiw"Add double quotes around a wordword"word"
ds"Delete surrounding double quotes"word"word
cs"'Change surrounding double quotes to single quotes"word"'word'
ysiw<em>Add <em> tags around a wordword<em>word</em>
cst<p>Change surrounding tags to <p> tags<em>word</em><p>word</p>

Key Mappings

OperatorKeyAction
ys) or bAdd ()
ys] or [Add []
ys} or { or BAdd {}
ys> or <Add <>
ystAdd tags
ds / cs) or bFor ()
ds / cs] or [For []
ds / cs} or { or BFor {}
ds / cs> or <For <>
ds / cstFor tags

HQ Key Mappings

gg / G Jump to top/bottom of page
j / k Scroll page up/down
h / l Focus navigation bar and move left/right
c / Escape Remove focus from nav bar / Close modal
x / Enter Follow a focused navigation link
t / T Cycle through site themes
m / M Toggle light/dark mode
f / / Open search dialog
? Open help dialog