DEV Community

Cover image for Neovim Matching Your System Theme 🌚🌞
Sean Boult
Sean Boult

Posted on

Neovim Matching Your System Theme 🌚🌞

In this post I'll show you how to get your theme in Neovim to match your system theme.

First you want to install dark-notify, here is how you'd do that with Homebrew.

brew install cormacrelf/tap/dark-notify
Enter fullscreen mode Exit fullscreen mode

Then you can setup the Neovim lazy companion plugin which will watch for changes via the dark-notify CLI.

Replace <lightTheme> and <darkTheme> with your preferred colorschemes (like "catppuccin-latte" and "catppuccin-mocha").

---@module "lazy"
---@type LazySpec
return {
  {
    "cormacrelf/dark-notify",
    config = function()
      require("dark_notify").run({
        schemes = {
          light = { colorscheme = "<lightTheme>" },
          dark = { colorscheme = "<darkTheme>" },
      })
    end,
  },
}
Enter fullscreen mode Exit fullscreen mode

Now you should be able to switch your system theme and it will automagically update your Neovim theme.

You can take a look at my Dotfiles and how I've configured it. If this article helped you out feel free to follow me for more tips and tricks.

Top comments (0)