サラウンドにはこれが組み込まれていません。属性をヤンクし<c-r>"てから、置換タグを入力して元に戻すときに使用できますが、それは少し不十分です。
このタスクを自動化する新しいマッピングと関数を提案します。以下は、cseマッピング、つまり周囲の要素の変更を提供します。これをあなたの~/.vimrcファイルに入れてください~/.vim/after/plugin/surround_change_element.vim。
function! s:ChangeElement()
execute "normal! vat\<esc>"
call setpos('.', getpos("'<"))
let restore = @"
normal! yi>
let attributes = substitute(@", '^[^ ]*', '', '')
let @" = restore
let dounmapb = 0
if !maparg(">","c")
let dounmapb = 1
" Hide from AsNeeded
exe "cn"."oremap > <CR>"
endif
let tag = input('<', '')
if dounmapb
silent! cunmap >
endif
let tag = substitute(tag, '>*$', '', '')
exe "normal cst<" . tag . attributes . ">"
endfunction
nnoremap cse :call <SID>ChangeElement()<cr>
注:またはeを介して作成した場合、これは周囲のいくつかのケースを覆い隠します。その場合は、周囲のノードを変更するために、マッピング フォームを別のものに変更します。g:surround_101b:surround_101csecsn
編集
2015 年 2 月 22 日現在、この回答は古くなっています。@Wojtek Kruszewski の投稿、または:h surround-replacementsサラウンドでネイティブにこれを行う方法を参照してください。