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 ++++++++------------ vimrc | 7 ------- 2 files changed, 8 insertions(+), 19 deletions(-) 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 diff --git a/vimrc b/vimrc index 2d68fb9..c58371f 100644 --- a/vimrc +++ b/vimrc @@ -158,12 +158,5 @@ let g:Textobj_defs = [ \['\|', 'Textobj_paired', '\|'], \] " }}} -" Load plugins that don't use vim's format {{{ -" just loading this directly from the plugin directory fails because language -" syntax files override the highlighting -" using BufWinEnter because that is run after modelines are run (so it catches -" modelines which update highlighting) -autocmd vimrc BufWinEnter,FileType * runtime plugin/rainbow_paren.vim -" }}} " }}} " vim: fdm=marker -- cgit v1.2.3-54-g00ecf