From ba860a3f8b3b53690099b231f6ee43688deeb896 Mon Sep 17 00:00:00 2001 From: othree_kao Date: Fri, 22 Feb 2013 14:30:39 +0800 Subject: [PATCH] Change toggle function name --- README.markdown | 2 +- plugin/eregex.vim | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.markdown b/README.markdown index 2bc9df5..96f7027 100644 --- a/README.markdown +++ b/README.markdown @@ -14,7 +14,7 @@ After installed. Just press / or ? for search, it will map to :M command. You can call EregexToggle funtion to toggle the keymapping. For example, add the following line into your .vimrc file: - nnoremap / :call EregexToggle() + nnoremap / :call eregex#toggle() Then you can use <leader>/ to toggle eregex.vim. diff --git a/plugin/eregex.vim b/plugin/eregex.vim index 48207fa..1997991 100644 --- a/plugin/eregex.vim +++ b/plugin/eregex.vim @@ -288,7 +288,7 @@ unlet s:tmp s:maj s:min "v260 let s:enable = 0 -function! EregexToggle(...) +function! eregex#toggle(...) let silent = 0 if exists('a:1') && a:1 let silent = 1 @@ -309,7 +309,9 @@ function! EregexToggle(...) let s:enable = 1 - s:enable endfun -call EregexToggle(1) +if !(exists('g:eregex_default_enable') && g:eregex_default_enable == 0) + call eregex#toggle(1) +endif "============================================================================= "Functions: