From cfc6654855d84001b24a09c5bd5b2d7a9a57f0c0 Mon Sep 17 00:00:00 2001 From: Israel Chauca Fuentes Date: Tue, 18 Jun 2013 16:02:37 -0400 Subject: [PATCH] Make jumping over space and CR expansions optional and off by default. - Closes #130. - Closes #110. - As suggested in #95. --- autoload/delimitMate.vim | 5 ++++- doc/delimitMate.txt | 13 +++++++++++++ plugin/delimitMate.vim | 3 +++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/autoload/delimitMate.vim b/autoload/delimitMate.vim index 0fc8ba6..83c0ea8 100644 --- a/autoload/delimitMate.vim +++ b/autoload/delimitMate.vim @@ -21,6 +21,10 @@ function! delimitMate#ShouldJump(...) "{{{ return 1 endif + if !b:_l_delimitMate_jump_expansion + return 0 + endif + " Closing delimiter with space expansion. let nchar = delimitMate#GetCharFromCursor(1) if !a:0 && b:_l_delimitMate_expand_space && char == " " @@ -40,7 +44,6 @@ function! delimitMate#ShouldJump(...) "{{{ elseif a:0 && b:_l_delimitMate_expand_cr && uchar == a:1 return 5 endif - return 0 endfunction "}}} diff --git a/doc/delimitMate.txt b/doc/delimitMate.txt index 3bb4b5d..329246c 100644 --- a/doc/delimitMate.txt +++ b/doc/delimitMate.txt @@ -91,6 +91,8 @@ specific file types, see |delimitMateOptionDetails| for examples. |'delimitMate_expand_space'| Turns on/off the expansion of . +|'delimitMate_jump_expansion'| Turns on/off jumping over expansions. + |'delimitMate_smart_quotes'| Turns on/off the "smart quotes" feature. |'delimitMate_smart_matchpairs'| Turns on/off the "smart matchpairs" feature. @@ -214,6 +216,17 @@ e.g.: > let delimitMate_expand_space = 1 au FileType tcl let b:delimitMate_expand_space = 1 < +------------------------------------------------------------------------------ + *'delimitMate_jump_expansion'* + *'b:delimitMate_jump_expansion'* +Values: 1 or 0 ~ +Default: 0 ~ +This option turns on/off the jumping over and expansions when +inserting closing matchpairs. Read |delimitMateExpansion| for details. +e.g.: > + let delimitMate_jump_expansion = 1 + au FileType tcl let b:delimitMate_jump_expansion = 1 +< ------------------------------------------------------------------------------ *'delimitMate_smart_quotes'* *'b:delimitMate_smart_quotes'* diff --git a/plugin/delimitMate.vim b/plugin/delimitMate.vim index 6c6e3e9..a2c2c1b 100644 --- a/plugin/delimitMate.vim +++ b/plugin/delimitMate.vim @@ -113,6 +113,9 @@ function! s:init() "{{{ endif call s:option_init("expand_cr", 0) + " jump_expansion + call s:option_init("jump_expansion", 0) + " smart_matchpairs call s:option_init("smart_matchpairs", '^\%(\w\|\!\|£\|\$\|_\|["'']\s*\S\)')