rainbow_parentheses.vim icon indicating copy to clipboard operation
rainbow_parentheses.vim copied to clipboard

Disable in Vim compatible mode. Add a global to detect if loaded.

Open robert-claypool opened this issue 7 years ago • 0 comments

  1. Disable this plugin if 'compatible' is set.
  2. Add a global to detect the presence of this plugin.

I use g:loaded_rainbow_parentheses in .vimrc like so:

function! SetupPlugins()
    if exists('g:loaded_rainbow_parentheses')
        echom "Configuring Rainbow Parentheses..."
        autocmd FileType json,javascript,css,html RainbowParenthesesActivate
        autocmd Syntax javascript RainbowParenthesesLoadRound
        autocmd Syntax json,javascript RainbowParenthesesLoadSquare
        autocmd Syntax json,javascript,css RainbowParenthesesLoadBraces
        autocmd Syntax html RainbowParenthesesLoadChevrons
    endif
endfunction

" Plugins are loaded after Vim has finished processing .vimrc,
" so we test for their existence and configure them on VimEnter.
autocmd VimEnter * call SetupPlugins()

This change is consistent with tpope plugins, for example see https://github.com/tpope/vim-fugitive/blob/master/plugin/fugitive.vim#L6

robert-claypool avatar Jun 14 '17 20:06 robert-claypool