diff --git a/README.md b/README.md index 8d079ba..3208495 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,11 @@ Options Default: {'(':')', '[':']', '{':'}',"'":"'",'"':'"', "`":"`", '```':'```', '"""':'"""', "'''":"'''"} +* g:ExtraAutoPairs + + Append to pristine dictionary of pairs rather than overwriting the it. + let g:ExtraAutoPairs = {'<':'>'} + * b:AutoPairs Default: g:AutoPairs diff --git a/plugin/auto-pairs.vim b/plugin/auto-pairs.vim index af5eb32..dfc7498 100644 --- a/plugin/auto-pairs.vim +++ b/plugin/auto-pairs.vim @@ -16,6 +16,13 @@ if !exists('g:AutoPairs') let g:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '```':'```', '"""':'"""', "'''":"'''", "`":"`"} end +" Extend default dictionary with extra pair dictionary +" This feature is useful when user doesn't want to disturb the pristine AutoPairs +" dictionary. +if exists('g:ExtraAutoPairs') + call extend(g:AutoPairs, g:ExtraAutoPairs) +end + " default pairs base on filetype func! AutoPairsDefaultPairs() if exists('b:autopairs_defaultpairs')