The following shows how to replicate some of Surround's features if you don't happen to have it installed.
NOTE: We only dealt with the simplest cases, here, and the convoluted nature of some of these commands shows how well designed and useful that plugin is. And let's not talk about all the corner cases it handles.
Install it, it's worth it.
-
ys<motion><thing>
:" surround current word with parentheses " surround: ysiw) ciw(<C-r>")<Esc>
-
vS<thing>
:" surround current visual selection with square brackets " surround: S] c[<C-r>"]<Esc>
-
ds'
,ds"
, andds`
:" delete surrounding single quotes " surround: ds' di'vhP
-
ds<
with<:>
added to:help matchpairs
,ds(
,ds{
, andds[
:" delete surrounding parentheses " surround: ds) di(v%P
-
dst
:" delete surrounding *ML tag " surround: dst ditvatP
-
cs'<thing>
,cs"<thing>
, andcs`<thing>
:" change surrounding single quotes to double quotes " surround: cs'" di'vh"_c"<C-r>""<Esc>
-
cs<<thing>
with<:>
added to:help matchpairs
,cs(<thing>
,cs{<thing>
, andcs[<thing>
:" change surrounding parentheses to braces " surround: cs)} di("_c%{<C-r>"}<Esc>
-
cst<new>
:" change surrounding *ML tag to <new>…</new> " surround: cst<new<CR> dit"_cat<new><C-r>"</new><Esc>