Automatically set background on local sunrise/sunset time.
Vim script
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This is a mirror of


Sunset automatically sets 'background' when the sun rises and sets, and also when you start Vim. When the sun is up, or rises, it'll 'set background=light'. When the sun is down, or sets, it'll 'set background=dark'.

Sunset can also change your 'colorscheme', your Powerline ( theme, or anything else you can think of. See �Sunset_daytime_callback()' and �Sunset_nighttime_callback()' in the documentation for details.

So as not to interrupt you, Sunset waits for four seconds (on the CursorHold event) after you've pressed a key or left insert mode before changing the background. If you change your background during the day or night, it'll respect that.


If you feel that Sunset can be improved, pull requests and issues are appreciated and humbly requested, on Github at:


Vim compiled with +float support. Use ':version' to check if this feature is available in your build.

Requires a system with 'strftime()', with the following format options:
- %j returns the current day of the year.
- %H returns the current hour of the day in 24-hour time.
- %M returns the current minute of the hour.

A colorscheme with both light and dark variants, such as Solarized ( or Hemisu (