diff --git a/doc/surround.txt b/doc/surround.txt
index 30a642a..41943e7 100644
--- a/doc/surround.txt
+++ b/doc/surround.txt
@@ -39,8 +39,9 @@ easiest to understand with some examples:
Yo!*
dst Yo!
Change surroundings is *cs* . It takes two arguments, a target like with
-|ds|, and a replacement. Details about the second argument can be found
-below in |surround-replacements|. Once again, examples are in order.
+|ds|, and a replacement. *cS* changes surroundings, placing the surrounded
+text on its own line(s) like |yS|. Details about the second argument can be
+found below in |surround-replacements|. Once again, examples are in order.
Old text Command New text ~
"Hello *world!" cs"' 'Hello world!'
diff --git a/plugin/surround.vim b/plugin/surround.vim
index 148a5c9..e283ed2 100644
--- a/plugin/surround.vim
+++ b/plugin/surround.vim
@@ -441,7 +441,8 @@ function! s:dosurround(...) " {{{1
endif
call setreg('"',keeper,regtype)
if newchar != ""
- call s:wrapreg('"',newchar)
+ let special = a:0 > 2 ? a:3 : 0
+ call s:wrapreg('"',newchar, special)
endif
silent exe 'norm! ""'.pcmd.'`['
if removed =~ '\n' || okeeper =~ '\n' || getreg('"') =~ '\n'
@@ -456,11 +457,11 @@ function! s:dosurround(...) " {{{1
if newchar == ""
silent! call repeat#set("\Dsurround".char,scount)
else
- silent! call repeat#set("\Csurround".char.newchar.s:input,scount)
+ silent! call repeat#set("\C".(a:0 > 2 && a:3 ? "S" : "s")."urround".char.newchar.s:inpur,scount)
endif
endfunction " }}}1
-function! s:changesurround() " {{{1
+function! s:changesurround(...) " {{{1
let a = s:inputtarget()
if a == ""
return s:beep()
@@ -469,7 +470,7 @@ function! s:changesurround() " {{{1
if b == ""
return s:beep()
endif
- call s:dosurround(a,b)
+ call s:dosurround(a,b,a:0 && a:1)
endfunction " }}}1
function! s:opfunc(type,...) " {{{1
@@ -558,6 +559,7 @@ endfunction " }}}1
nnoremap SurroundRepeat .
nnoremap Dsurround :call dosurround(inputtarget())
nnoremap Csurround :call changesurround()
+nnoremap CSurround :call changesurround(1)
nnoremap Yssurround :call opfunc(v:count1)
nnoremap YSsurround :call opfunc2(v:count1)
" discards the numerical argument but there's not much we can do with it
@@ -571,6 +573,7 @@ inoremap ISurround =insert(1)
if !exists("g:surround_no_mappings") || ! g:surround_no_mappings
nmap ds Dsurround
nmap cs Csurround
+ nmap cS CSurround
nmap ys Ysurround
nmap yS YSurround
nmap yss Yssurround