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: