Skip to content

Commit

Permalink
Added an option 'o' for setting custom surround
Browse files Browse the repository at this point in the history
It is sometimes nice to be able to just type in the expression rather
then prepare it ahead of the time.
  • Loading branch information
NonLogicalDev authored and somini committed Sep 10, 2017
1 parent e49d6c2 commit 5cf3ddb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugin/surround.vim
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ function! s:wrap(string,char,type,removed,special)
elseif newchar == "\<C-[>" || newchar == "\<C-]>"
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
Expand Down

0 comments on commit 5cf3ddb

Please sign in to comment.