summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2017-10-29 18:30:58 -0400
committerJesse Luehrs <doy@tozt.net>2017-10-29 19:03:53 -0400
commit69fa66b3b5c5855881b11c706fe395fe56aa8f38 (patch)
tree2514cfaf62258765a4d6947ef8771e976c39f4d3
parent2f68e0389d4078bd3cbdb55e62b4d5b4f501bb35 (diff)
downloadconf-69fa66b3b5c5855881b11c706fe395fe56aa8f38.tar.gz
conf-69fa66b3b5c5855881b11c706fe395fe56aa8f38.zip
switch to a more maintained rainbow parens plugin
-rw-r--r--.gitmodules3
m---------vim/pack/plugins/start/rainbow0
-rw-r--r--vim/plugin/rainbow_paren.vim100
-rw-r--r--vimrc29
4 files changed, 22 insertions, 110 deletions
diff --git a/.gitmodules b/.gitmodules
index 6f5cd94..37a3a16 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -94,3 +94,6 @@
[submodule "vim/pack/local/start/commentary"]
path = vim/pack/plugins/start/commentary
url = git://github.com/tpope/vim-commentary
+[submodule "vim/pack/plugins/start/rainbow"]
+ path = vim/pack/plugins/start/rainbow
+ url = git://github.com/luochen1990/rainbow
diff --git a/vim/pack/plugins/start/rainbow b/vim/pack/plugins/start/rainbow
new file mode 160000
+Subproject 1c45e0f81324641b23d4c21edda4eabeacba031
diff --git a/vim/plugin/rainbow_paren.vim b/vim/plugin/rainbow_paren.vim
deleted file mode 100644
index 9889983..0000000
--- a/vim/plugin/rainbow_paren.vim
+++ /dev/null
@@ -1,100 +0,0 @@
-" this script by Shawn M Moore aka Sartak <sartak at gmail.com>
-" also by Michael R Geddes aka frogonwheels <vimmer at frog.wheelycreek.net>
-" originally by anonymous
-
-" this in the public domain
-" last updated 25 Mar 07
-
-" this does nothing unless you,
-" let g:rainbow = 1
-
-" and set which kinds of character pairs you want to rainbow
-" let g:rainbow_paren = 1 " ()
-" let g:rainbow_brace = 1 " {}
-" let g:rainbow_bracket = 1 " []
-" let g:rainbow_angle = 1 " <>
-
-" if you want the different types to nest, such that the braces in ({}) are
-" 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
- 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'
- exe 'hi '.s:basename.'4c ctermfg=darkblue guifg=blue'
- exe 'hi '.s:basename.'5c ctermfg=darkmagenta guifg=magenta'
- " this color is never nested, it only appears on the outermost layer
- exe 'hi '.s:basename.'6c ctermfg=darkred guifg=red'
-
- " helper function
- func s:DoSyn(cur, top, left, right, uniq)
- let uniq = a:uniq
- if exists("g:rainbow_nested") && g:rainbow_nested != 0
- let uniq = ""
- endif
-
- let cmd = 'syn region '.s:basename.uniq.a:cur.' transparent fold matchgroup='.s:basename.a:cur.'c start=/'.a:left.'/ end=/'.a:right.'/ contains=TOP'
-
- let i = a:cur
-
- if i == 1
- let i = a:top
- endif
-
- while i <= a:top
- let cmd = cmd . ',' . s:basename . uniq . i
- let i = i + 1
- endwhile
- exe cmd
- endfunc
-
- func s:DoSyntaxes(count)
- let i = 1
-
- while i <= a:count
- " if you define new pairs, make sure to take into account that the
- " delimiter is currently / and that it uses regex, so you need to escape
- " regex metachars (like what is done for brackets)
-
- if exists("g:rainbow_paren") && g:rainbow_paren != 0
- " ocaml uses (* *) for comments; these shouldn't be highlighted
- if &filetype == "ocaml"
- call s:DoSyn(i, a:count, "(\\*\\@!", "\\*\\@<!)", "a")
- else
- call s:DoSyn(i, a:count, "(", ")", "a")
- endif
- endif
-
- if exists("g:rainbow_brace") && g:rainbow_brace != 0
- call s:DoSyn(i, a:count, "{", "}", "b")
- endif
-
- if exists("g:rainbow_bracket") && g:rainbow_bracket != 0
- call s:DoSyn(i, a:count, "\\[", "\\]", "c")
- endif
-
- if exists("g:rainbow_angle") && g:rainbow_angle != 0
- call s:DoSyn(i, a:count, "<", ">", "d")
- endif
-
- let i = i + 1
- endwhile
- endfun
-
- call s:DoSyntaxes(6) " 6 is the number of colors we have
-
- delfun s:DoSyn
- delfun s:DoSyntaxes
-endif
-
diff --git a/vimrc b/vimrc
index 9b55366..7249a71 100644
--- a/vimrc
+++ b/vimrc
@@ -125,9 +125,25 @@ endfunction
autocmd vimrc VimEnter * call <SID>configure_neosnippet_tab_mappings()
" }}}
" rainbow {{{
-let g:rainbow = 1
-let g:rainbow_paren = 1
-let g:rainbow_brace = 1
+let g:rainbow_active = 1
+let g:rainbow_conf = {
+\ 'ctermfgs': [
+\ 'darkred',
+\ 'darkmagenta',
+\ 'darkblue',
+\ 'darkyellow',
+\ 'darkgreen',
+\ 'darkcyan',
+\ ],
+\ 'guitermfgs': [
+\ 'red',
+\ 'magenta',
+\ 'blue',
+\ 'yellow',
+\ 'green',
+\ 'cyan',
+\ ],
+\}
" }}}
" startify {{{
let g:startify_list_order = ['dir', 'bookmarks', 'commands']
@@ -151,12 +167,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