Skip to content

Fuann-Kinoko/auto-dark-windows.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auto-dark-windows.nvim

Auto-dark-mode.nvim for Windows

This is a plugin that enables automatic dark mode switching on Windows using Neovim.

Only been tested on Windows10 22H2 and intended for personal use.

Not recommend installing it as a plugin.

auto-dark-mode.nvim

A Neovim plugin for macOS that automatically changes the editor appearance based on system settings. demo

Installation

Using vim-plug

Plug 'f-person/auto-dark-mode.nvim'

Configuration

You need to call setup before initialization. setup accepts a table with options – set_dark_mode function, set_light_mode function, and update_interval integer.

set_dark_mode is called when the system appearance changes to dark mode, and set_light_mode is called when it changes to light mode. By default, they just change the background option but you can do whatever you like.

update_interval is how frequently the system appearance is checked. The value is stored in milliseconds. Defaults to 3000.

local auto_dark_mode = require('auto-dark-mode')

auto_dark_mode.setup({
	update_interval = 1000,
	set_dark_mode = function()
		vim.api.nvim_set_option('background', 'dark')
		vim.cmd('colorscheme gruvbox')
	end,
	set_light_mode = function()
		vim.api.nvim_set_option('background', 'light')
		vim.cmd('colorscheme gruvbox')
	end,
})
auto_dark_mode.init()

Using lazy

return {
  "f-person/auto-dark-mode.nvim",
  config = {
    update_interval = 1000,
    set_dark_mode = function()
      vim.api.nvim_set_option("background", "dark")
      vim.cmd("colorscheme gruvbox")
    end,
    set_light_mode = function()
      vim.api.nvim_set_option("background", "light")
      vim.cmd("colorscheme gruvbox")
    end,
  },
  init = function()
    require("auto-dark-mode").init()
  end,
}

Disable

You can disable aut-dark-mode.nvim at runtime via lua require('aut-dark-mode').disable().

Requirements

  • macOS
  • Neovim

Support

If you enjoy the plugin and want to support what I do

Buy Me A Coffee

About

neovim plugin forked from auto-dark-mode for Windows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%