Sunset : Automatically set background on local sunrise/sunset time.
| script karma
Downloaded by 1024
Comments, bugs, improvements
script versions (upload new version)
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 (https://github.com/Lokaltog/vim-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: http://github.com/amdt/sunset
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 (http://github.com/altercation/vim-colors-solarized) or Hemisu (http://github.com/noahfrederick/Hemisu).
|Installation is provided here with a Vimball. See ':help vimball' for installation instructions. If you prefer a package manager or manual install, please see the previously mentioned Github page.|
Click on the package to download.
ip used for rating: 188.8.131.52
||* Made 'g:sunset_utc_offset' optional
(thanks to 'andreax79': https://github.com/amdt/sunset/pull/11)
* Fixed an issue that caused a 'E122' error with the 'restore_cpoptions' function
||* Fixed an issue where 'cpoptions' may not be restored when the script finishes early
* Updated the function names for the 'Sunset_daytime_callback()' and 'Sunset_nighttime_callback()' callbacks to match changes to the VimL interpreter
||Fixed an issue where versions of Vim greater than 7.4.260 would not allow this script to run. (https://github.com/amdt/sunset/issues/8)
||- Sunset now switches your background (or calls your callbacks) mid-way
through Civil Twilight time.
- *Note:* Sunset 2.0.0 breaks compatibility with previous versions of
Sunset for users of the `sunset_callback()` callback.
'sunset_daytime_callback()' and 'sunset_nighttime_callback()' are
||- Fix table of contents numbering in documentation.
- New behaviour with 'sunset_daytime_callback()' and 'sunset_nighttime_callback()'.
- sunset_callback() has been deprecated and will be removed in the next release.