rainbow_parentheses.vim
rainbow_parentheses.vim copied to clipboard
Disable in Vim compatible mode. Add a global to detect if loaded.
- Disable this plugin if 'compatible' is set.
- 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