diff --git a/README.md b/README.md index a65845a..d467cf9 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ Options ------- * g:AutoPairs - Default: {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`'} + Default: {'(':')', '[':']', '{':'}',"'":"'",'"':'"', "`":"`", '```':'```', '"""':'"""', "'''":"'''"} * b:AutoPairs diff --git a/plugin/auto-pairs.vim b/plugin/auto-pairs.vim index 7ee07a7..99bf15b 100644 --- a/plugin/auto-pairs.vim +++ b/plugin/auto-pairs.vim @@ -13,7 +13,7 @@ end let g:AutoPairsLoaded = 1 if !exists('g:AutoPairs') - let g:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '```':'```', '"""':'"""', "'''":"'''"} + let g:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '```':'```', '"""':'"""', "'''":"'''", "`":"`"} end if !exists('g:AutoPairsMapBS') @@ -410,7 +410,11 @@ func! AutoPairsSpace() continue end if before =~ '\V'.open.'\v$' && after =~ '^\V'.close - return "\\".s:Left + if close =~ '\v^[''"`]$' + return "\" + else + return "\\".s:Left + end end endfor return "\"