@@ -0,0 +1,35 @@
1+---
2+layout: post
3+---
4+
5+Easy way to randomly choose a vim colorscheme
6+---------------------------------------------
7+
8+Sunnyvale, Feb 26, 2013
9+
10+Have you ever caught yourself cycling through your colorschems with `:colo <TAB>`? I have and I always endup using a colorscheme from the subset that I know and like.
11+
12+The Idea: What if vim new what subset is that? Which colorschemes I like?
13+
14+Solution: Tell vim exactly that.
15+
16+Create an collection of colorschemes you like, put them in your config with this code:
17+
18+{% highlight vim %}
19+
20+ function! ToggleScheme()
21+ if has("gui_running")
22+ " this is the collection of colorschemes
23+ let schemes = 'FreshCut Peacock Revelation TronLegacy Yule'
24+ let seconds = str2nr(strftime('%S'))
25+ " number needs to match the schemes count
26+ execute 'colorscheme '.split(schemes)[seconds%5]
27+ redraw
28+ endif
29+ endfunction
30+ command! ToggleScheme :call ToggleScheme()
31+ map <leader>x :ToggleScheme<CR>
32+ set background=dark
33+ call ToggleScheme()
34+
35+{% endhighlight %}