From 511981fa01fa751054307518325750498b48aa78 Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Wed, 3 Dec 2014 14:33:43 -0500 Subject: [PATCH] Add vim plugin for rainbow clojure parens --- vim/bundle/rainbow_parentheses.vim | 1 + vimrc | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) create mode 160000 vim/bundle/rainbow_parentheses.vim diff --git a/vim/bundle/rainbow_parentheses.vim b/vim/bundle/rainbow_parentheses.vim new file mode 160000 index 0000000..eb8baa5 --- /dev/null +++ b/vim/bundle/rainbow_parentheses.vim @@ -0,0 +1 @@ +Subproject commit eb8baa5428bde10ecc1cb14eed1d6e16f5f24695 diff --git a/vimrc b/vimrc index c06eb54..94c90f1 100644 --- a/vimrc +++ b/vimrc @@ -104,10 +104,12 @@ set undoreload=10000 " When loading text files, wrap them and don't split up words. au BufNewFile,BufRead *.txt setlocal wrap au BufNewFile,BufRead *.txt setlocal lbr - " Clojurescript syntax highlighting au BufNewFile,BufRead *.cljs set filetype=clojure +" Remove trailing whitespace on save all files. +au BufWritePre * :%s/\s\+$//e + " Fix vim's background colour erase - http://snk.tuxfamily.org/log/vim-256color-bce.html if &term =~ '256color' " Disable Background Color Erase (BCE) so that color schemes @@ -134,8 +136,15 @@ map pn :sp ~/jelly/documents/Notes/stack.txt map sn :sp ~/jelly/documents/software-notes/pcg-dive.md map rn :sp ~/work/pcg/files/notes/refactoring-notes.md -" Remove trailing whitespace on save all files. -au BufWritePre * :%s/\s\+$//e +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" CLOJURE AND CLOJURESCRIPT +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +" Rainbow parens ala rainbow_parentheses.vim +au VimEnter * RainbowParenthesesToggle +au Syntax * RainbowParenthesesLoadRound +au Syntax * RainbowParenthesesLoadSquare +au Syntax * RainbowParenthesesLoadBraces """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " COLORS @@ -145,8 +154,15 @@ set background=light let g:airline_theme = 'pencil' " Switch between light and dark -map l :set background=dark -map ll :set background=light +map l :call ChangeBgTheme("dark") +map ll :call ChangeBgTheme("light") + +function! ChangeBgTheme(theme) + exec ":set background=" . a:theme + " Have to run this twice to get the plugin to set the colors + exec ":RainbowParenthesesToggle" + exec ":RainbowParenthesesToggle" +endfunction """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " CUSTOM AUTOCMDS