Created
July 19, 2013 16:04
-
-
Save imwilsonxu/6040324 to your computer and use it in GitHub Desktop.
Set Vim colorscheme by time of day, an example from book Learning Vi and Vim.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SetTimeOfDayColors() | |
let g:Favcolorschemes = ["darkblue", "morning", "shine", "evening"] | |
let g:CurrentHour = (strftime("%H") + 0) / 6 | |
if g:colors_scheme !~ g:Favcolorschemes[g:CurrentHour] | |
execute "colorscheme " . g:Favcolorschemes[g:CurrentHour] | |
redraw | |
endif | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment