Giter VIP home page Giter VIP logo

circadian.nvim's Introduction

Circadian.nvim

Port of the circadian.el plugin I like so much in Emacs

This plugin changes automatically between 2 themes according to the sunrise and sunset times at your location. It literally uses an astronomical formula to obtain the hours from the current date, the latitude, and the longitude in order to set the colorschemes correctly for you.

Fork details

  • Add option to make plugin silent

Setup

No configuration option is mandatory. Calling the setup function will set the colorscheme according to the time of day, if the relevant option (day or night) is filled.

require('circadian').setup({
  -- Latitude: Defaults to Paris' latitude
  lat = 0.0,
  -- Longitude: Defaults to Paris' longitude
  lon = 0.0,
  -- Stop notifying on event
  silent = false,
  -- Day theme: the background is optional, but useful for themes that
  -- control light/dark variants with it. Defaults to nil everywhere
  -- (will not change a thing when Sun rises)
  day = { background = "light", colorscheme = "alabaster" },
  -- Night theme: the background is optional, but useful for themes that
  -- control light/dark variants with it. Defaults to nil everywhere
  -- (will not change a thing when Sun sets)
  night = { background = "dark", colorscheme = "catpuccin" },
  night_callback = function end,
  day_callback = function end,
})

Good add-on

Totally unrelated, but Circadian is a little noisy on the log side, so using something like nvim-notify or any other vim.notify handler is going to feel good.

Alpha state

  • I don't know how it works with all the themes that are full lua and need a setup() function call with options
  • I don't know how robust the algorithm is when switching between day and night (especially if you have a neovim started at night until the next sunrise)
  • Probably a bunch of other things are going to fail

circadian.nvim's People

Contributors

ajaymamtora avatar gagbo 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.