Skip to content

Commit 5cf3ddb

Browse files
NonLogicalDevsomini
authored andcommitted
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.
1 parent e49d6c2 commit 5cf3ddb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugin/surround.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,11 @@ function! s:wrap(string,char,type,removed,special)
244244
elseif newchar == "\<C-[>" || newchar == "\<C-]>"
245245
let before = "{\n\t"
246246
let after = "\n}"
247+
elseif newchar ==# 'o'
248+
let replacement = substitute(input(">> "),"\\\\r","\r", '')
249+
let all = s:process(replacement)
250+
let before = s:extractbefore(all)
251+
let after = s:extractafter(all)
247252
elseif newchar !~ '\a'
248253
let before = newchar
249254
let after = newchar

0 commit comments

Comments
 (0)