hg-ypw
Last Updated: February 25, 2016
·
402
· pjambet
9fafb69190a2986f46731f42c2a4bcf9

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
Say Thanks
Respond

2 Responses
Add your response

5849
8ebbfc71b48f7e65e71a08cc1430dd4c

Interesting idea! Did you test it since?

over 1 year ago ·
5850
9fafb69190a2986f46731f42c2a4bcf9

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 ·
Filed Under