ViM: load ‘random’ color scheme on startup

I downloaded some color schemes for vim but couldn’t decide which one to use – so why not use them all?

Here is a small script I wrote for changing color scheme, works on vim and gvim.
The string in the ‘schemes’ variable are the file names (without the extension) of the *.vim files located at the scheme directory (‘colors’).


let schemes = 'stingray sean reloaded maroloccio3 dw_yellow dw_red dw_blue dw_cyan dw_green dw_orange darkzen'
let seconds = str2nr(strftime('%S'))

execute 'colorscheme '.split(schemes)[seconds%11]
redraw

Put this code in your .vimrc file on startup for happy coding 🙂

About accessomat

technical blog about things i do and working on
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

Leave a comment