I have one of those super glossy monitors, so during the day I can see my own reflection better than my code on Dark themes. So I thought it'd be great if I could have a simple if
switch in my vimrc to set either a dark theme or a light theme based on the time of day.
Alas, I don't know enough about vimrc syntax and googling came up short.
Anyone wanna take a crack at this?
Something like the following should do the trick:
if strftime("%H") < 12 set background=light else set background=dark endif
Obviously you should choose the hour based on your needs
This is not strictly a Vim answer but you could try to install f.lux which adjusts your monitor colours to the time of the day.
Here is a demo. It has a warm yellowish glow during the day, and blueish one during the night.
Disclaimer : I have not tried it myself (but I am tempted).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With