Shortcuts

System Shortcuts:
<CR> : Insert new indented line after return if cursor in blank brackets or quotes.
<BS> : Delete brackets in pair
<M-p> : Toggle Autopairs (g:AutoPairsShortcutToggle)
<M-e> : Fast Wrap (g:AutoPairsShortcutFastWrap)
<M-n> : Jump to next closed pair (g:AutoPairsShortcutJump)
<M-b> : BackInsert
If <M-p> <M-e> or <M-n> conflict with another keys or want to bind to another keys, add
let g:AutoPairShortcutToggle = '<another key>'
to .vimrc, it the key is empty string '', then the shortcut will be disabled.

Options

g:AutoPairs

Default: {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`'}

g:AutoPairsShortcutToggle

Default: '<M-p>'
The shortcut to toggle autopairs.

g:AutoPairsShortcutFastWrap

Default: '<M-e>'
Fast wrap the word. all pairs will be consider as a block (include <>).
(|)'hello' after fast wrap at |, the word will be ('hello')
(|)<hello> after fast wrap at |, the word will be (<hello>)

Default : 1
When g:AutoPairsMapCR is on, center current line after return if the line is at the bottom 1/3 of the window.

g:AutoPairsMapSpace

Default : 1
Map <space> to insert a space after the opening character and before the closing one.
execute 'inoremap <buffer> <silent> <CR> <C-R>=AutoPairsSpace()<CR>'

g:AutoPairsFlyMode

Default : 0
set it to 1 to enable FlyMode.
see FlyMode section for details.

g:AutoPairsShortcutBackInsert

Default : <M-b>
Work with FlyMode, insert the key at the Fly Mode jumped postion

TroubleShooting

The script will remap keys ([{'"}]) <BS>,
If auto pairs cannot work, use :imap ( to check if the map is corrected.
The correct map should be <C-R>=AutoPairsInsert("\(")<CR>
Or the plugin conflict with some other plugins.
use command :call AutoPairsInit() to remap the keys.