Dear all,
I have a rather simple task. I would like Vim to change the colour scheme depending on the time of the day. Please find my solution below. I place it into my ~/.vimrc file. I'm wondering, maybe there is a more elegant way to do it? Maybe there is a built-in Vim function to enquire the hour of the day?
let hr = substitute(system('date +%H'), "\n", "", "")
" colour scheme setting
if (hr >= 6) && (hr < 18)
colorscheme solarized8_light
else
colorscheme solarized8_dark
endif
Thank you for your help!
—
Best wishes,
Maxim
No comments:
Post a Comment