From 370bb2ab2f141cdcfb611e766cb92684e475d5fd Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 12 Feb 2007 15:37:15 +0000 Subject: [PATCH] surround_insert_tail, xmap rather than vmap --- plugin/surround.vim | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/plugin/surround.vim b/plugin/surround.vim index cb80acd..586eb27 100644 --- a/plugin/surround.vim +++ b/plugin/surround.vim @@ -333,6 +333,10 @@ function! s:insert(...) " {{{1 let reg_save = @@ call setreg('"',"\r",'v') call s:wrapreg('"',char,linemode) + " This can be used to append a placeholder to the end + if exists("g:surround_insert_tail") + call setreg('"',g:surround_insert_tail,"a".getregtype('"')) + endif "if linemode "call setreg('"',substitute(getreg('"'),'^\s\+','',''),'c') "endif @@ -560,10 +564,18 @@ if !exists("g:surround_no_mappings") || ! g:surround_no_mappings nmap ySs YSsurround nmap ySS YSsurround if !hasmapto("Vsurround","v") - vmap s Vsurround + if exists(":xmap") + xmap s Vsurround + else + vmap s Vsurround + endif endif if !hasmapto("VSurround","v") - vmap S VSurround + if exists(":xmap") + xmap S VSurround + else + vmap S VSurround + endif endif if !hasmapto("Isurround","i") && !mapcheck("","i") imap Isurround