From 5cf3ddbcd49853914efcb1b08b35b796f5d742f7 Mon Sep 17 00:00:00 2001 From: AkaiBureido Date: Fri, 31 May 2013 19:40:22 -0700 Subject: [PATCH] Added an option 'o' for setting custom surround It is sometimes nice to be able to just type in the expression rather then prepare it ahead of the time. --- plugin/surround.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin/surround.vim b/plugin/surround.vim index 46f3252..c6bda22 100644 --- a/plugin/surround.vim +++ b/plugin/surround.vim @@ -244,6 +244,11 @@ function! s:wrap(string,char,type,removed,special) elseif newchar == "\" || newchar == "\" let before = "{\n\t" let after = "\n}" + elseif newchar ==# 'o' + let replacement = substitute(input(">> "),"\\\\r","\r", '') + let all = s:process(replacement) + let before = s:extractbefore(all) + let after = s:extractafter(all) elseif newchar !~ '\a' let before = newchar let after = newchar