Skip to content
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

Possibility to set 'light' colorscheme as default #152

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maxdollinger
Copy link

I tried to set the light colorscheme as default but was unable to. Found this elsif statement prevented it.

I tried to set the light colorscheme as default but was unable to.
Found this elsif statement prevented it.
@xeluxee
Copy link
Contributor

xeluxee commented Mar 18, 2023

Before setting light theme you should set to light the value of vim.o.background option (see #34 (comment)).
This is intentional because when this option is toggled (from light to dark and vice versa) onedark can automatically update and change palette.

As this looks confusing to new users I'd like making style picking like nightfox (see #108), to make it easier to switch between theme variants. Do you agree @navarasu?

@maxdollinger
Copy link
Author

Thank you very much for the explanation. It's a bit of a confusing and unexpected behaviour, as it's not necessary with the other themes. Then as a transitional solution I suggest to include this special case in the documentation.
For me, I'll leave it as is since it allowed me to write simple commands for switching themes.

     local add_change_theme_cmd = function(cmd, theme)
        vim.api.nvim_create_user_command(cmd, function()
          local config = vim.g.onedark_config
          config['style'] = theme
          vim.g.onedark_config = config
          vim.cmd(":colorscheme onedark")
        end, {})
      end

      add_change_theme_cmd("Light", "light")
      add_change_theme_cmd("Dark", "darker")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants