A Neovim plugin that automatically changes your colorscheme based on a schedule, system settings, or manually. Generated by OpenAI o1, colorful-times
allows for a dynamic and personalized editing experience.
- Scheduled Colorscheme Changes: Define time slots with specific colorschemes and backgrounds.
- System Background Detection: Automatically adjust the background based on your system's light/dark mode.
- Custom System Background Detection on Linux: Specify a custom command or function to detect the system background.
- Configurable Refresh Time: Set how often the plugin checks for system background changes.
- Manual Toggle and Reload: Easily enable/disable the plugin or reload the configuration without restarting Neovim.
- User Commands: Control the plugin with
:ColorfulTimesToggle
and:ColorfulTimesReload
. - Notifications: Receive feedback when the plugin is toggled or reloaded.
Use your preferred plugin manager to install colorful-times
. For example, with lazy.nvim:
return {
"luxus/colorful-times-nvim",
enabled = true,
lazy = false, -- Load the plugin immediately
opts = {
default = {
colorscheme = "default",
background = "system",
},
schedule = {
{ start = "04:50", stop = "17:00", colorscheme = "night-owl" },
{ start = "17:00", stop = "18:00", colorscheme = "default" },
},
refresh_time = 5000, -- Refresh time in milliseconds
},
}
schedule
(array): List of schedule entries withstart
,stop
,colorscheme
, and optionalbackground
.default
(table): Default colorscheme and background when no schedule matches.enabled
(boolean): Whether the plugin is enabled on startup.refresh_time
(integer): How often (in milliseconds) to check for system background changes.system_background_detection
(string|function|nil): Custom command or function to detect the system background on Linux.
Each schedule entry should have:
start
(string): Start time in "HH:MM" format.stop
(string): Stop time in "HH:MM" format.colorscheme
(string): Name of the colorscheme to apply.background
(string|nil): "light", "dark", "system", ornil
to use the default background.
:ColorfulTimesToggle
: Toggle the plugin on or off.:ColorfulTimesReload
: Reload the plugin configuration.
If you prefer, you can control the plugin programmatically:
require('colorful-times').toggle()
require('colorful-times').reload()
- System Background Detection on macOS:
- The plugin uses the
defaults
command to detect light/dark mode.
- The plugin uses the
- Custom System Background Detection on Linux:
- Provide a custom command or function via
system_background_detection
to detect the system background. - If not set and 'system' is used as the background, the plugin falls back to the default background or leaves it unchanged.
- Provide a custom command or function via
- Colorscheme Availability:
- Ensure that the colorschemes specified in your schedule are installed and accessible in Neovim.
This plugin is licensed under the MIT License.