Surround does not have this built in. You can yank the attributes and then use <c-r>"
when typing out the replacement tag to bring them back, but that is a bit lame.
I propose a new mapping and function that will automate this task. The following will provide the cse
mapping, aka change surrounding element. Put this in a your ~/.vimrc
file or maybe ~/.vim/after/plugin/surround_change_element.vim
if you feel overly orangized.
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>
Note: this will shadow some cases of surroundings with e
if you have any created via g:surround_101
or b:surround_101
. If that is the case change the mapping form cse
to something else maybe csn
for change surrounding node.
EDIT
As of February 22, 2015 this answer is out of date. Please see @Wojtek Kruszewski post or :h surround-replacements
for how to do this natively with surround.