Skip to content

cosmicboots/system-theme.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

system-theme.nvim

This plugin uses system D-Bus messages to automatically switch Neovim between light and dark modes.

Installation

Because this plugin depends on Luarocks packages, it's recommended to install using lazy.nvim (version 11.x or later):

{
    "cosmicboots/system-theme.nvim",
    config = {
        dark_theme = "sorbet",
        light_theme = "morning",
    },
}

Configuration

The configuration passed into the setup function follows this format:

{
    light_theme = "your-light-theme", -- Light theme to use
    dark_theme = "your-dark-theme", -- Dark theme to use
    hooks = {
        light = function()
            -- This is run after the light theme is applied
        end,
        dark = function()
            -- This is run after the dark theme is applied
        end,
    },
}

All settings are optional. If light_theme or dark_theme aren't set, the global vim variables g:light_theme and g:dark_theme will be used, respectively.

Usage

This plugin will try to stay out of your way.

If you need to terminate the thread processing system D-Bus messages, the :SysThemeDbusKill command is provided. This will prevent the plugin from listening for system theme changes until Neovim is restarted.

About

Keep Neovim in sync with your system color scheme

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages