Skip to content

feature: Switch between dark and light variants #369

Open
@ifab

Description

@ifab

Is your feature request related to a problem? Please describe.

Many popular Neovim themes automatically choose between a dark and a light variant, depending on whether vim.o.background is set to "dark" or "light". This is very useful if one frequently switches between a dark and a light theme in the terminal. Currently, Nightfox seems to be missing this feature.

Describe the solution you'd like

The solution implemented in Catppuccin, for example, is great. It provides the following configuration option:

background = { -- :h background
    light = "latte",
    dark = "mocha",
},

Other themes such as TokyoNight and Kanagawa have similar options.

Describe alternatives you've considered

I currently use the following workaround, which is far from ideal:

vim.api.nvim_create_autocmd({ "VimEnter" }, {
  callback = function()
    vim.cmd("sleep 1m")
    if vim.o.background == "dark" then
      vim.cmd("colorscheme nightfox")
    else
      vim.cmd("colorscheme dayfox")
    end
  end,
})

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions