Skip to content
This repository was archived by the owner on Oct 16, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions doc/AutoClose.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ will not insert the closing character for you.
3.2 Defining protected regions |ac_protectedregions|
3.3 Turning AutoClose on and off |ac_turnon|
3.4 Selection wrap prefix |ac_wrapPrefix|
3.5 Not closing in ahead of characters |ac_donotclose|
4. Under the hood |ac_details|
4.1 Mappings |ac_mappings|

Expand Down Expand Up @@ -255,6 +256,16 @@ want to do that task:

And if you don't want to map anything, just use them on the command mode.

*ac_donotclose* *AutoCloseDoNotCloseBefore*
3.5 Not closing in ahead of characters

You may explicitly define a set of characters to never close in front of.
By default, these characters are defined as " and '. Example:

>
let g:AutoCloseDoNotCloseBefore = "()"
<

*ac_wrapPrefix* *AutoCloseSelectionWrapPrefix*

3.5 Selection wrap prefix~
Expand Down
2 changes: 2 additions & 0 deletions plugin/AutoClose.vim
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ function! s:InsertPair(opener)
let l:next = s:GetNextChar()
" only add closing pair before space or any of the closepair chars
let close_before = '\s\|\V\[,.;' . escape(join(keys(b:AutoClosePairs) + values(b:AutoClosePairs), ''), ']').']'
let close_before = substitute(close_before, '[' . b:AutoCloseDoNotCloseBefore . ']', '', 'g')
if (l:next == "\0" || l:next =~ close_before) && s:AllowQuote(a:opener, 0)
call s:InsertStringAtCursor(b:AutoClosePairs[a:opener])
call s:PushBuffer(b:AutoClosePairs[a:opener])
Expand Down Expand Up @@ -373,6 +374,7 @@ function! s:DefineVariables()
\ 'AutoClosePumvisible': {"ENTER": "\<C-Y>", "ESC": "\<C-E>"},
\ 'AutoCloseExpandEnterOn': "",
\ 'AutoCloseExpandSpace': 1,
\ 'AutoCloseDoNotCloseBefore': "'\"",
\ }

" Let the user define if he/she wants the plugin to do special actions when the
Expand Down