From cd3a10fc6d0e6f2fcfe284624a9d179d0b80bf1e Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 4 Nov 2017 23:13:08 -0400 Subject: clean up the rainbow_paren plugin a bit --- vim/plugin/rainbow_paren.vim | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'vim') diff --git a/vim/plugin/rainbow_paren.vim b/vim/plugin/rainbow_paren.vim index 9889983..c104287 100644 --- a/vim/plugin/rainbow_paren.vim +++ b/vim/plugin/rainbow_paren.vim @@ -18,17 +18,8 @@ " colored the same as the internal parens of (()), then " let g:rainbow_nested = 1 -" you probably also want to use something like -" autocmd BufWinEnter * runtime plugin/rainbow_parens.vim - -if exists("g:rainbow") && g:rainbow != 0 - if &ft == 'perl' - " wow, this is a huge huge hack, but indentation is broken without it - " see $VIMRUNTIME/indent/perl.vim:125-162 - let s:basename = 'perlSubFoldRainbowLevel' - else - let s:basename = 'level' - endif +function! Rainbow() + let s:basename = 'level' exe 'hi '.s:basename.'1c ctermfg=darkcyan guifg=cyan' exe 'hi '.s:basename.'2c ctermfg=darkgreen guifg=green' exe 'hi '.s:basename.'3c ctermfg=darkyellow guifg=yellow' @@ -96,5 +87,10 @@ if exists("g:rainbow") && g:rainbow != 0 delfun s:DoSyn delfun s:DoSyntaxes -endif +endfunction +if exists("g:rainbow") && g:rainbow + augroup rainbow + autocmd BufWinEnter,FileType * call Rainbow() + augroup END +endif -- cgit v1.2.3-54-g00ecf