Vim field guide · dot-files
vim-surround: Add, Change and Delete Quotes, Brackets and Tags
Add, change, or delete surrounding characters — quotes, brackets, tags — with single keypresses.
Add a surrounding (ys)
ys{motion}{char}
Opening bracket adds spaces; closing bracket does not.
Surround a whole line
yss" → surrounds the entire line (ignoring indent)
Change a surrounding (cs)
cs{old}{new}
Delete a surrounding (ds)
ds{char}
Visual mode (S)
Select text visually, then press S{char}:
v + select + S" → wraps selection in double quotes
v + select + St → wraps selection in an HTML tag