Skip to content

ollbx/dark-mode-win.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

dark-mode-win.nvim

This is a simple plugin to detect the dark mode in Windows, making it easy to adapt the color theme accordingly.

Example usage:

local dmw = require('dark-mode-win')

if dmw.is_dark() then
    vim.opt.background = 'dark'
    vim.cmd.colorscheme('nightfox')
else
    vim.opt.background = 'light'
    vim.cmd.colorscheme('dayfox')
end

The result of the detection is cached, but can be updated by calling detect().

Function Description
is_dark() Returns true when the dark theme is active.
is_light() Returns true when the light theme is active.
detect() Updates the cached result of the detection.
theme() Returns "dark" or "light" as a string.

About

Dark mode detection on Windows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages