GithubHelp home page GithubHelp logo

sunset's Introduction

GitHub tag GitHub last commit (master) License: Vim

Sunset

Project Status

This project is unmaintained and archived. Feel free to exercise your right under the license to fork this project.

Introduction

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 and 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.

You must set some options in your .vimrc for Sunset to work, so please read on for details.

If you feel that Sunset can be improved, pull requests (on the develop branch, please) and issues are appreciated and humbly requested.

Installation

If you don't already have a preferred installation method, I recommend installing Vundle. Once done, add the declaration for Sunset to your .vimrc:

Bundle 'amdt/sunset'

And install:

:BundleInstall

Note: other installation methods are detailed in the included documentation.

Requirements

  • Sunset requires Vim 7.3

  • 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.

Note: If your system's strftime() differs, please open an issue on the project's GitHub page with details.

Recommended:

Configuration

Note: If you push your dotfiles to (for example) GitHub, please see the section titled 'A Reminder on Privacy'.

g:sunset_latitude & g:sunset_longitude

The latitude and longitude of your location in decimal. Values North and East must be positive values, those South and West must be negative.

London, for example, lies at 51 degrees, 30 minutes North; and 7 minutes West.

In decimal, this is 51.5 degrees North, 0.1167 degrees West.

If you lived in London, you might set these options as follows:

let g:sunset_latitude = 51.5
let g:sunset_longitude = -0.1167

If you lived in Tokyo (35 degrees, 40 minutes and 12 seconds North; 139 degrees, 46 minutes and 12 seconds East), you might set these options as follows:

let g:sunset_latitude = 35.67
let g:sunset_longitude = 139.8

Note: Don't forget, negative values South and West.

g:sunset_utc_offset

The difference in hours between your timezone and Coordinated Universal Time.

For example:

let g:sunset_utc_offset = 0 " London
let g:sunset_utc_offset = 1 " London (British Summer Time)
let g:sunset_utc_offset = 9 " Tokyo

Note: Sunset does not handle any daylight savings civil times.

A Reminder on Privacy

For those of us who publish our dotfiles on (for example) GitHub etc., please take this as a gentle reminder that out of habit you might be about to publish your whereabouts to the greater public. If this concerns you, using the location of your nearest large city might suffice; Sunset will be plenty accurate enough.

License

Sunset is distributed under the same terms as Vim itself. See :help license for details.

sunset's People

Contributors

amdt avatar andreax79 avatar p7g avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.