sponsor Vim development Vim logo go to HTTPS page Vim Book Ad

Auto Changing color script : Syntax highlight colors change gradually based on minutes of hour

 script karma  Rating 43/43, Downloaded by 4263    Comments, bugs, improvements  Vim wiki

created by
Paul Contreras
 
script type
color scheme
 
description
Why not try my customising Vim help page:
http://www.ezrider.co.uk/VimTagsHelp/

Inspired by an ex (no pun intended) of mine who was good at producing music .

WARNING: this script allocates highlight groups many times an hour!! repeated calls to Highlight does eventually exhaust Vim's 'gui' allocations which is fixed.  If you find the background going black simply restart Vim -only really happens if you leave color changing on for about 3 hours without actually using Vim 'cause then the allocations run non-stop.   :)

Colors schemes are all one color.  why? let's make it more creative.

..colors roll smoothly around the clock.  plus your old one still works just add:
  let permanentColorScheme = "{YOURFAVCOLORSCHEME}" --> _vimrc

And it becomes active in between edits and :write cycles!

NEW!!  Help file added.  Please be patient, only function Rgb2a() explained.  I will get around to doing more.

To try it just open the changingColor.vim e.g.
  :e .vim/plugin/changingColor.vim

then try Ctrl-] over wherever you see Rgb2a().  You can help on the parameters.  It's even in the familiar vim help colours.  
 
install details
Open changingColor.vmb / vba in VIM, do a :so % on the command line.  Restart VIM completely.  Chaging color starts working ~ ten seconds.  Installs 4 files, changingColor.vim, changingColorHelp.txt, changingColorTags, and timer.vim.

TO REMOVE: easy, just do a :RmVimball changingColor and restart.  No need to put .vmb / vba at the end.  Once you restart it's gone completely.

if you'd rather use your own choice of in-edit colorscheme, add a line: let permanentColorScheme = "{YOURFAVCOLORSCHEME}",  e.g
    let permanentColorScheme = "desert".  If you don't set this the default is darkblue (i think)
 

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
changingColor.vmb 22.5 2017-07-13 7.0 Paul Contreras Made initial greeting message clear. it now appears in color and remains visible longer plus made a re-welcome if you leave the text file you were editing > 30 min which then cues right into the changing color
changingColor.vmb 22.4 2017-07-10 7.0 Paul Contreras Added a little greeting message the first time Changing Color script runs which also informs you of the current date and time.
changingColor.vmb 22.3 2017-06-22 7.0 Paul Contreras Took off some not necessary highlights to conserve as much resources as possible.  Added this missing SpecialChar which is the format specifier in C scanf family functions.
changingColor.vmb 22.2 2017-06-09 7.0 Paul Contreras Included Number, seems this is in MacVim not in Win Vim which was weird because the number constants remained the same.  Also tweaks to Normal to remain more stable  Fixed an attempted fix in 22.0 of Operator which forgot to add at the end :$ but through testing found it.  Operator, SpecialKey and with temp variables.  Now everything is just added to one big variable and done in one go.  It's also a lot more clearer to read.
changingColor.vmb 22.1 2017-06-08 7.0 Paul Contreras made the timing mechanism more smooth.  Now the highlights are only ever touched when there's really going to be a change to them.  actually there was just an exit clause 'if it wasn't time' yet but now that's gone instead you just get a smooth call to the function only when it's time to do something.
changingColor.vmb 22.0 2017-06-08 7.0 Paul Contreras Operator highlight group did not have a definition
sorted this out temporarily so that it works
nice enough,>:P but I know this sucks
later gonna add a proper nice green color for it.
changingColor.vba 21.1 2016-01-25 7.0 Paul Contreras The Normal forground was adjusted.  All I did was moved the adjustment for lighter background down a bit so as to be less agressive because it wasn't making it much clearer!
changingColor.vba 21.0 2016-01-15 7.0 Paul Contreras There's two things here.  First of all I removed a rather ugly feature.  But more importantly is the TAGS i've used to do this.  Basically, in the code where the main change happened I've added a TAG and this steps you through hand-holding style through the changes I've made in the script.  It's how VIM is fundamentally made.  That's it's power. That and combined with it's incredible :help system make it the best editor in the business, and maybe one of the greatest of ALL TIME ever created! I like it because it takes someone rather like me, not that clever, and gives them power tools for logic (TAGS) ability to bundle language help (:help) as well as a nice code editor and sit back and enjoy. I need a few hits on this so you could help and you might learn something.  please check out: http://www.ezrider.co.uk/VimTagsHelp -A.N.Other Spanish guy trying to rule the WORLD argh.. (it even might be good if there weren't 1000's of us all plotting and scheming the same thing arghh.... should have just stuck to writing Quill adventures!)
changingColor.vba 20.7 2015-02-25 7.0 Paul Contreras Slight improvements to Constant esp. at high light settings.
changingColor.vba 20.6 2015-02-24 7.0 Paul Contreras Further gave tweaks to Comment because there were effects that were making it worse.  Cleaned it up.
changingColor.vba 20.5 2015-02-24 7.0 Paul Contreras Gave Comment a tweak at high brightness backgrounds because it looked to much like Normal in this.
changingColor.vba 20.4 2015-02-24 7.0 Paul Contreras Gave Constant and Identifier a bit of a tweak at high brightness background.  The green of Identifier also looks nice and flouro at low light backgrounds.  You  can actually see the green still at light backgrounds.
changingColor.vba 20.3 2015-02-11 7.0 Paul Contreras I forgot the vital tags files, only really useful if you wanna see help on it.  This does not affect the scripts at all.  If you've previously installed it just make sure you run :RmVimball changingColor and just re-install it by loading changingColor.vba and doing :so %.  That will get rid of any rubbish.
changingColor.vba 20.2 2015-02-10 7.0 Paul Contreras Had a third look and decided about 33% should do it.  That is about 33% of the shades are no good.  That's roughly 1/3 so sounds about right.  They are just too "in the grey area" to be clear highlight.  They needed to be removed.
changingColor.vba 20.1 2015-02-03 7.0 Paul Contreras Had a look at it and decided ~25% was still too low and there were still some murky shades too difficult to see.  I didn't want to cut too much of the continuity but I think 30% is a necessary step towards improvement
changingColor.vba 20.0 2015-02-03 7.0 Paul Contreras After careful consideration have decided that some of the shades in my script are too difficult to see.  I was trying to have one smooth continuum between light and dark but the exact middle point is always making me strain to read no matter what I do, and this looks poor compared to other color schemes so I decided to create a ramped "jump over" the exact mid-point. You will still see constant changes but when it gets to a certain mid point it will jump about 20% of the murky shades to the next point after that.
changingColor.vba 19.3 2014-12-03 7.0 Paul Contreras Tweaked visibility of Normal, edge case.  It appears that due to a calibration issue I was having with my monitor I'd got this wrong previously.  I had thought that it was massively out but it was a "Power Saving feature of my EeePC that made it look hard to read. Not generally applicable in most cases.  Fixed to be similar to what it was in 19.0.
ip used for rating: 23.20.8.41

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.
   
SourceForge.net Logo