sponsor Vim development Vim logo Vim Book Ad

DayTimeColorer : Change color scheme according to position of the sun.

 script karma  Rating 2/2, Downloaded by 950  Comments, bugs, improvements  Vim wiki

created by
red rampage
 
script type
color scheme
 
description
This plugin calculates dawn, dusk, sunrise and sunset times and sets one of the four user defined color schemes according to sun position.
Git repo: https://bitbucket.org/redrampage/daytime-colorer-vim
Your vim must be compiled with +float feature.
Plugin uses algorithm from "Almanac for Computers, 1990"
Which description has been found at:
http://williams.best.vwh.net/sunrise_sunset_algorithm.htm
Idea of plugin is taken from:
http://allaboutvim.blogspot.com/2011/01/blog-post.html
...and turned into overkill =)
Automatic refresh code is taken from: vimscript #2658
 
install details
Put the daytimecolorer.vim into .vim/plugin/
And add following lines into your .vimrc:

" Define color schemes
let g:dtcDayScheme = "pyte"
let g:dtcNightScheme = "wombat256"
" Those are optional
let g:dtcDawnScheme = "zenburn"
let g:dtcDuskScheme = "zenburn"

" Set coordinates of your place
let g:dtcLatitude = 59.935
let g:dtcLongitude = 30.325

" Set your timezone
let g:dtcTimeOffset = 4

" Enable automatic color refresh (updates color scheme without restarting vim, but may use some extra resources)
let g:dtcAutoRefresh = 1
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
daytimecolorer.vim 0.1.1 2011-04-24 7.0 red rampage Fixed screen flicker and unnecessary color scheme reloading
daytimecolorer.vim 0.1 2011-04-24 7.0 red rampage Initial upload
ip used for rating: 18.189.2.122

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github