summaryrefslogtreecommitdiffstats
path: root/vim
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2017-11-04 23:13:08 -0400
committerJesse Luehrs <doy@tozt.net>2017-11-04 23:44:20 -0400
commitcd3a10fc6d0e6f2fcfe284624a9d179d0b80bf1e (patch)
tree311cb2edd34e015d52b33a0a3857ce99ad425488 /vim
parent3fcb921077ae6aee0e25afef5d23c368c90ec3d3 (diff)
downloadconf-cd3a10fc6d0e6f2fcfe284624a9d179d0b80bf1e.tar.gz
conf-cd3a10fc6d0e6f2fcfe284624a9d179d0b80bf1e.zip
clean up the rainbow_paren plugin a bit
Diffstat (limited to 'vim')
-rw-r--r--vim/plugin/rainbow_paren.vim20
1 files changed, 8 insertions, 12 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