• Stars
    star
    293
  • Rank 141,034 (Top 3 %)
  • Language
    Lua
  • License
    GNU General Publi...
  • Created over 2 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Neovim plugin for macOS, Linux & Windows that automatically changes the editor appearance based on system settings.

auto-dark-mode.nvim

A Neovim plugin for macOS, Linux, and Windows that automatically changes the editor appearance based on system settings.

macOS demo
Linux demo
Linux demo
Windows demo
Windows demo

Installation

Using vim-plug

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

Requirements

Configuration

You need to call setup for 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,
})

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,
  },
}

Disable

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

Thanks To

Support

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

Buy Me A Coffee

More Repositories

1

git-blame.nvim

Git Blame plugin for Neovim written in Lua
Lua
871
star
2

timeow-mac

macOS menubar app that displays how long you've been actively using your computer. It is configurable, and keeps track of active sessions and breaks
Go
58
star
3

youtube_caption_scraper

A Dart package that parses subtitles/captions from YouTube
Dart
18
star
4

hayatar

An attempt in building an Armenian keyboard for iOS that's usable and feels native
Objective-C++
16
star
5

pubspec-assist-nvim

Easily add dependencies to your Dart / Flutter project without leaving Neovim
Lua
15
star
6

flutter_persistent_keyboard_height

Flutter package to get keyboard height. Can be used to display a sticker/emoji modal with correct height.
Dart
14
star
7

lua-timeago

Simple Lua library library for displaying dates as relative time ago language
Lua
8
star
8

keyboard_emoji_picker

Flutter plugin for picking emojis using device's keyboard
Dart
8
star
9

toor

Compile-time safe & easy dependency management in Dart
Dart
6
star
10

flutter_protected_work

A Flutter package that helps you to remotely control the usability of your app.
Dart
5
star
11

punycode_converter

Punycode (IDN) converter
Dart
4
star
12

jaspr_bloc

Components that make it easy to integrate blocs and cubits into jaspr
Dart
4
star
13

diadon

CLI for posting on Mastodon and diaspora*
Python
4
star
14

yandex-music-genius

Display lyrics from Genius in Yandex Music web player
JavaScript
2
star
15

lab

Code experiments
C++
2
star
16

analytics-server

A simple analytics server in Go
Go
2
star
17

percentage-calculator

TypeScript
2
star
18

dotfiles

C
2
star
19

nvim-sort-dart-imports

Sort Dart imports in an organized way
Lua
2
star
20

xerxes

XERXES the most powerful DoS tool
C
2
star
21

codestats-menu

Live Code::Stats info in Mac menu bar
Swift
2
star
22

f-person

2
star
23

username-count_in_jabber_logs

Python
1
star
24

nvim

my neovim config 🌚
Lua
1
star
25

fssg

f static site generator. probably tries to suck less.
Go
1
star
26

tootfaver

A Mastodon bot that favourites toots from local timeline
JavaScript
1
star
27

protonmail-autologin

userscript to autologin to protonmail
JavaScript
1
star
28

parkview_enhancer

Adds useful features for enjoying South Park on the official website
JavaScript
1
star