From 02199ea0080d744ec76b79d74ce56d51d25cf7ae Mon Sep 17 00:00:00 2001 From: Takatoshi Matsumoto Date: Mon, 21 Jan 2013 16:11:42 +0900 Subject: [PATCH] Support to disable mappings only for insert mode If disable mappings only in normal mode. let g:surround_no_insert_mappings = 1 --- plugin/surround.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugin/surround.vim b/plugin/surround.vim index e0aac1d..e387157 100644 --- a/plugin/surround.vim +++ b/plugin/surround.vim @@ -567,11 +567,13 @@ if !exists("g:surround_no_mappings") || ! g:surround_no_mappings nmap ySS YSsurround xmap S VSurround xmap gS VgSurround - if !hasmapto("Isurround","i") && "" == mapcheck("","i") - imap Isurround + if !exists("g:surround_no_insert_mappings") || ! g:surround_no_insert_mappings + if !hasmapto("Isurround","i") && "" == mapcheck("","i") + imap Isurround + endif + imap s Isurround + imap S ISurround endif - imap s Isurround - imap S ISurround endif " vim:set ft=vim sw=2 sts=2 et: