Thursday, September 17, 2020

Re: [change colour scheme depending on time of day]

Hi Maxim,

>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", "", "")

I believe strftime("%H") will do what you want. According to the help, this isn't particularly portable, so ymmv.

Al

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200917220753.GA13368%40sleipnir.

No comments: