-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: Switch between dark and light variants #369
Comments
Hi there, Firstly, thank you for reaching out with your suggestions for Nightfox! However, I want to clarify a few things about Nightfox's current structure. As it stands, Nightfox differs from the other styles you've mentioned in a fundamental way. The main issue is that Nightfox doesn't have a concept of a style or variant. In contrast, the other color schemes you referred to can change their primary theme based on a configuration setting. For instance, invoking catppuccin might yield either a mocha or latte theme, depending on a config option. Nightfox, on the other hand, has distinct, standalone color schemes. When you call colorscheme nightfox, it will consistently apply the Nightfox theme. I are hesitant to introduce a configuration option that could make the call to Nightfox ambiguous regarding the actual color scheme applied. |
Thanks for your quick response! I understand that you do not want to introduce any ambiguity into the interface. So maybe it is better if I ask the following question: What is the recommended way to automatically switch between two colorschemes, say Nightfox and Dayfox, depending on the value of I'm not too happy with my current workaround solution (mentioned above) because:
|
When you use the command -- ~/.config/nvim/colors/something.lua
local style = vim.o.background == "light" and "dayfox" or "nightfox"
require("nightfox.config").set_fox(name)
require("nightfox").load() Then you can call Just an idea on how I would handle this use case. |
Thanks for the suggestion! Unfortunately this does not seem to work. The selected colorscheme is always Nightfox, regardless of the terminal background color. I think the reason is that Neovim sets I guess I will keep using the workaround for the time being. But just out of curiosity, how do you make use of your different colorschemes? Do you just switch them manually, or perhaps always use the same? |
I have what some would say an overly complicated setup for handling themes. I create an autocmd at startup on the event As for syncing my theme with my terminal I have a shell script that I use to write to all the appropriate places. I use wezterm as my terminal so when I make the change to the wezterm config it will hot reload the change. That script also writes to that neovim theme cache file. This means that if I am on my laptop outside and I need a light theme I call You can find my dotfiles in the repo nyx (another way to say nix). My config is built around nix but you can find my config files for nvim here. Hope you find some of these ideas interesting. |
Thank you very much for the detailed reply, I really appreciate the time you took to answer my questions! Indeed your setup seems a bit complicated, but now I understand why you have no personal need for the feature described above. Anyway, just in case you want to provide this feature in
metafox = {
light = "dayfox",
dark = "nightfox",
}, This way you keep the behavior of |
I have a script with It would be great if this theme would support that, as it makes that a generic solution so I can manage themes inside nvim config, without having to change that script too |
the metafox idea from ifab is really good. i think a lot of us are used from websites/phones where you can switch between dark and light themes easily depending on time of the day or surrounding lighting conditions. please consider adding this! regardless, the whole nightfox collection is amazing -- thank you for all your work! |
Another different idea, zsh/bash functions: Example using zsh to change nvim + wezterm colors:
With this you can just do Note: Change the path to the colorschemes accordingly. |
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:
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:
Additional context
No response
The text was updated successfully, but these errors were encountered: