Improve loading time when matchparen_enabled=0

Also be more robust in loading pi_paren's plugin/matchparen.vim
cf. #25, cf. SpaceVim/SpaceVim/#1482
This commit is contained in:
Andy K. Massimino
2018-04-02 14:49:10 -04:00
parent 2f4c4a9261
commit fb09f4ae8e
3 changed files with 20 additions and 11 deletions

View File

@@ -30,14 +30,18 @@ if exists('g:loaded_matchit')
endif
let g:loaded_matchit = 1
if get(g:, 'matchup_matchparen_enabled', 1)
if !exists('g:loaded_matchparen')
runtime plugin/matchparen.vim
endif
" ensure pi_paren is loaded but deactivated
try
runtime plugin/matchparen.vim
au! matchparen
command! NoMatchParen call matchup#matchparen#toggle(0)
command! DoMatchParen call matchup#matchparen#toggle(1)
endif
catch /^Vim\%((\a\+)\)\=:E216/
unlet! g:loaded_matchparen
runtime plugin/matchparen.vim
silent! au! matchparen
let g:loaded_matchparen = 1
endtry
command! NoMatchParen call matchup#matchparen#toggle(0)
command! DoMatchParen call matchup#matchparen#toggle(1)
if get(g:, 'matchup_override_vimtex', 0)
let g:vimtex_matchparen_enabled = 0