Skip to content

Conversation

@robert-claypool
Copy link

  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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants