Last Updated: January 28, 2019
·
546
· pjambet

Use different vim theme based on time of day

I use solarized theme for almost everything it's awesome. As I wanted a different look and feel for professional work and personal work, I came up with those few lines in my vimrc, so theme is picked based on the current time. (I'm not 100% sure this will work, but I like the idea)

let current_time = strftime('%H:%M:%S.0 %z')
if current_time < "20:00:00.0" || current_time > "10:00:00.0"
  set bg=light
else
  set bg=dark
endif

2 Responses
Add your response

Interesting idea! Did you test it since?

over 1 year ago ·

Just wrote it a few hours ago, so we'll see if it works tonight :D No but I checked by changing the conditions, and from what I saw it was working well !

over 1 year ago ·