ff10804d581c

vim: fix rainbow parens
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 09 Mar 2011 09:59:40 -0500
parents 4e31b1166768
children d845a82775fb 5ca6eb1c7622
branches/tags (none)
files vim/.vimrc vim/bundle/rainbow/autoload/rainbow_parentheses.vim vim/bundle/rainbow/plugin/rainbow_parentheses.vim

Changes

--- a/vim/.vimrc	Wed Mar 09 09:34:05 2011 -0500
+++ b/vim/.vimrc	Wed Mar 09 09:59:40 2011 -0500
@@ -491,6 +491,11 @@
 let g:CommandTMaxHeight = 20
 
 " }}}
+" LISP (built-in) {{{
+
+let g:lisp_rainbow = 1
+
+" }}}
 
 " }}}
 " Synstack -------------------------------------------------------------------- {{{
--- a/vim/bundle/rainbow/autoload/rainbow_parentheses.vim	Wed Mar 09 09:34:05 2011 -0500
+++ b/vim/bundle/rainbow/autoload/rainbow_parentheses.vim	Wed Mar 09 09:59:40 2011 -0500
@@ -1,31 +1,13 @@
 "------------------------------------------------------------------------------
-"  Description: Rainbow colors for parentheses
-"    Copyright: Copyright (C) 2007 Martin Krischik
-"   Maintainer: Martin Krischik (krischik@users.sourceforge.net)
-"               John Gilmore
-"               Luc Hermitte (hermitte@free.fr)
-"      Version: 4.0
-"      History: 24.05.2006 MK Unified Headers
-"               15.10.2006 MK Bram's suggestion for runtime integration
-"               06.09.2007 LH Buffer friendly (can be used in different buffers),
-"                             can be toggled
-"               09.09.2007 MK Use on LH's suggestion but use autoload to
-"                             impove memory consumtion and startup performance
-"               09.10.2007 MK Now with round, square brackets, curly and angle
-"                             brackets.
-"        Usage: copy to autoload directory.
-"------------------------------------------------------------------------------
-" This is a simple script. It extends the syntax highlighting to
-" highlight each matching set of parens in different colors, to make
-" it visually obvious what matches which.
-"
-" Obviously, most useful when working with lisp or Ada. But it's also nice other
-" times.
+"  Description: Rainbow colors for parentheses, based on rainbow_parenthsis.vim
+"               by Martin Krischik and others.  This version cleans things up,
+"               simplifies a few things, and changes "parenthsis" to
+"               "parentheses".
 "------------------------------------------------------------------------------
 
 " Section: highlight {{{1
 
-function rainbow_parentheses#Activate()
+function! rainbow_parentheses#Activate()
     highlight default level1c   guifg=OrangeRed1
     highlight default level2c   guifg=LightGoldenRod1
     highlight default level3c   guifg=DeepSkyBlue1
@@ -42,36 +24,36 @@
     highlight default level14c  guifg=HotPink1
     highlight default level15c  guifg=chartreuse1
     highlight default level16c  guifg=Yellow
-    let s:rainbow_parenthesis_active = 1
+    let s:rainbow_paren_active = 1
 endfunction
 
-function rainbow_parentheses#Clear()
+function! rainbow_parentheses#Clear()
     let i = 0
     while i != 16
         let i = i + 1
         exe 'highlight clear level' . i . 'c'
     endwhile
-    let s:rainbow_parenthesis_active = 0
+    let s:rainbow_paren_active = 0
 endfunction
 
-function rainbow_parentheses#Toggle ()
-    if ! exists('rainbow_parenthesis_active')
-        call rainbow_parentheses#LoadRound ()
+function! rainbow_parentheses#Toggle ()
+    if !exists('s:rainbow_paren_active')
+        call rainbow_parentheses#LoadRound()
     endif
-    if s:rainbow_parenthesis_active != 0
-        call rainbow_parentheses#Clear ()
+    if s:rainbow_paren_active != 0
+        call rainbow_parentheses#Clear()
     else
-        call rainbow_parentheses#Activate ()
+        call rainbow_parentheses#Activate()
     endif
 endfunction
 
 " Section: syntax {{{1
-"
+
 syntax cluster  rainbow_parentheses contains=@TOP,level1,level2,level3,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15,level16,NoInParens
 
 " Subsection: parentheses or round brackets: {{{2
 "
-function rainbow_parentheses#LoadRound ()
+function! rainbow_parentheses#LoadRound ()
     syntax region level1 matchgroup=level1c start=/(/ end=/)/ contains=TOP,level1,level2,level3,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens
     syntax region level2 matchgroup=level2c start=/(/ end=/)/ contains=TOP,level2,level3,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens
     syntax region level3 matchgroup=level3c start=/(/ end=/)/ contains=TOP,level3,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens
@@ -88,12 +70,12 @@
     syntax region level14 matchgroup=level14c start=/(/ end=/)/ contains=TOP,level14,level15, level16,NoInParens
     syntax region level15 matchgroup=level15c start=/(/ end=/)/ contains=TOP,level15, level16,NoInParens
     syntax region level16 matchgroup=level16c start=/(/ end=/)/ contains=TOP,level16,NoInParens
-    let s:rainbow_parenthesis_active = 0
+    let s:rainbow_paren_active = 0
 endfunction
 
 " Subsection: box brackets or square brackets: {{{2
 "
-function rainbow_parentheses#LoadSquare ()
+function! rainbow_parentheses#LoadSquare ()
     syntax region level1 matchgroup=level1c start=/\[/ end=/\]/ contains=TOP,level1,level2,level3,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens
     syntax region level2 matchgroup=level2c start=/\[/ end=/\]/ contains=TOP,level2,level3,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens
     syntax region level3 matchgroup=level3c start=/\[/ end=/\]/ contains=TOP,level3,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens
@@ -110,12 +92,12 @@
     syntax region level14 matchgroup=level14c start=/\[/ end=/\]/ contains=TOP,level14,level15, level16,NoInParens
     syntax region level15 matchgroup=level15c start=/\[/ end=/\]/ contains=TOP,level15, level16,NoInParens
     syntax region level16 matchgroup=level16c start=/\[/ end=/\]/ contains=TOP,level16,NoInParens
-    let s:rainbow_parenthesis_active = 0
+    let s:rainbow_paren_active = 0
 endfunction
 
 " Subsection: curly brackets or braces: {{{2
 "
-function rainbow_parentheses#LoadBraces ()
+function! rainbow_parentheses#LoadBraces ()
     syntax region level1 matchgroup=level1c start=/{/ end=/}/ contains=TOP,level1,level2,level3,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens
     syntax region level2 matchgroup=level2c start=/{/ end=/}/ contains=TOP,level2,level3,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens
     syntax region level3 matchgroup=level3c start=/{/ end=/}/ contains=TOP,level3,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens
@@ -132,12 +114,12 @@
     syntax region level14 matchgroup=level14c start=/{/ end=/}/ contains=TOP,level14,level15, level16,NoInParens
     syntax region level15 matchgroup=level15c start=/{/ end=/}/ contains=TOP,level15, level16,NoInParens
     syntax region level16 matchgroup=level16c start=/{/ end=/}/ contains=TOP,level16,NoInParens
-    let s:rainbow_parenthesis_active = 0
+    let s:rainbow_paren_active = 0
 endfunction
 
 " Subsection: angle brackets or chevrons: {{{2
 "
-function rainbow_parentheses#LoadChevrons ()
+function! rainbow_parentheses#LoadChevrons ()
     syntax region level1 matchgroup=level1c start=/</ end=/>/ contains=TOP,level1,level2,level3,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens
     syntax region level2 matchgroup=level2c start=/</ end=/>/ contains=TOP,level2,level3,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens
     syntax region level3 matchgroup=level3c start=/</ end=/>/ contains=TOP,level3,level4,level5,level6,level7,level8,level9,level10,level11,level12,level13,level14,level15, level16,NoInParens
@@ -154,16 +136,9 @@
     syntax region level14 matchgroup=level14c start=/</ end=/>/ contains=TOP,level14,level15, level16,NoInParens
     syntax region level15 matchgroup=level15c start=/</ end=/>/ contains=TOP,level15, level16,NoInParens
     syntax region level16 matchgroup=level16c start=/</ end=/>/ contains=TOP,level16,NoInParens
-    let s:rainbow_parenthesis_active = 0
+    let s:rainbow_paren_active = 0
 endfunction
 
-   " }}}1
-finish
+" }}}1
 
-"------------------------------------------------------------------------------
-"   Copyright (C) 2006  Martin Krischik
-"
-"   Vim is Charityware - see ":help license" or uganda.txt for licence details.
-"------------------------------------------------------------------------------
-" vim: textwidth=78 wrap tabstop=8 shiftwidth=4 softtabstop=4 expandtab
-" vim: filetype=vim foldmethod=marker
+finish
--- a/vim/bundle/rainbow/plugin/rainbow_parentheses.vim	Wed Mar 09 09:34:05 2011 -0500
+++ b/vim/bundle/rainbow/plugin/rainbow_parentheses.vim	Wed Mar 09 09:59:40 2011 -0500
@@ -1,44 +1,13 @@
 "------------------------------------------------------------------------------
-"  Description: Rainbow colors for parenthsis
-"          $Id: rainbow_parenthsis.vim 51 2007-10-09 18:43:58Z krischik@users.sourceforge.net $
-"    Copyright: Copyright (C) 2006 Martin Krischik
-"   Maintainer: Martin Krischik
-"               John Gilmore
-"      $Author: krischik@users.sourceforge.net $
-"        $Date: 2007-10-09 14:43:58 -0400 (Tue, 09 Oct 2007) $
-"      Version: 4.0
-"    $Revision: 51 $
-"     $HeadURL: http://vim-scripts.googlecode.com/svn/trunk/1561%20Rainbow%20Parenthsis%20Bundle/plugin/rainbow_parenthsis.vim $
-"      History: 24.05.2006 MK Unified Headers
-"               15.10.2006 MK Bram's suggestion for runtime integration
-"               06.09.2007 LH Buffer friendly (can be used in different buffers),
-"                             can be toggled
-"               09.09.2007 MK Use on LH's suggestion but use autoload to
-"                             impove memory consumtion and startup performance
-"               09.10.2007 MK Now with round, square brackets, curly and angle
-"                             brackets.
-"        Usage: copy to plugin directory.
-"------------------------------------------------------------------------------
-" This is a simple script. It extends the syntax highlighting to
-" highlight each matching set of parens in different colors, to make
-" it visually obvious what matches which.
-"
-" Obviously, most useful when working with lisp or Ada. But it's also nice other
-" times.
+"  Description: Rainbow colors for parentheses, based on rainbow_parenthsis.vim
+"               by Martin Krischik.  This version cleans things up, simplifies
+"               a few things, and changes "parenthsis" to "parentheses".
 "------------------------------------------------------------------------------
 
-command! -nargs=0 RainbowParenthesesToggle call rainbow_parentheses#Toggle()
-command! -nargs=0 RainbowParenthesesLoadSquare call rainbow_parentheses#LoadSquare()
-command! -nargs=0 RainbowParenthesesLoadRound call rainbow_parentheses#LoadRound()
-command! -nargs=0 RainbowParenthesesLoadBraces call rainbow_parentheses#LoadBraces()
+command! -nargs=0 RainbowParenthesesToggle       call rainbow_parentheses#Toggle()
+command! -nargs=0 RainbowParenthesesLoadSquare   call rainbow_parentheses#LoadSquare()
+command! -nargs=0 RainbowParenthesesLoadRound    call rainbow_parentheses#LoadRound()
+command! -nargs=0 RainbowParenthesesLoadBraces   call rainbow_parentheses#LoadBraces()
 command! -nargs=0 RainbowParenthesesLoadChevrons call rainbow_parentheses#Chevrons()
 
 finish
-
-"------------------------------------------------------------------------------
-"   Copyright (C) 2006  Martin Krischik
-"
-"   Vim is Charityware - see ":help license" or uganda.txt for licence details.
-"------------------------------------------------------------------------------
-" vim: textwidth=78 wrap tabstop=8 shiftwidth=4 softtabstop=4 expandtab
-" vim: filetype=vim foldmethod=marker