cdmill / neomodern.nvim

A collection of modern themes for Neovim
Other
53 stars 3 forks source link

Colorscheme resets with lazyvim #20

Closed Wilcov closed 3 months ago

Wilcov commented 3 months ago

Hi,

i'm running into an issue with LazyVim where the neomodern colorscheme only activates properly after it's been installed. If you then exit neovim and start it up again the neomodern colorscheme will show briefly but then a different (perhaps scrambled) colorscheme gets loaded.

I've already stripped my neovim config to the bare minimum with only the lazy package manager and the neomodern colorscheme installed.

Can you confirm this is an issue or perhaps help me fix it?

Environment i'm running: OS: ArchLinux Neovim version: 0.10.0 Lazy version: eb49574 Neomodern version: 67167f2

Steps to reproduce: 1) rm ~/.config/nvim/* 2) rm -rf /.local/share/nvim 3) rm -rf ~/.cache/nvim 4) create the following init.lua file

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
        {
          "cdmill/neomodern.nvim",
          lazy = false,
          priority = 1000,
          config = function()
            require("neomodern").setup({
              style = "darkforest"
            })
            require("neomodern").load()
          end,
        },
})

5) start nvim, Lazy will start and install & update itself and neomodern. Neomodern will work at this point 6) exit neovim 7) start neovim again. The darkforest colorscheme will show briefly and then gets overwritten.

Maybe i'm missing something? Any help would be greatly appreciated :)

cdmill commented 3 months ago

I'm unable to reproduce this on my end, when I use your init.lua file neomodern loads fine for me after restarting neovim. Could you maybe attach an image of what it looks like after darkforest is shown briefly and then is overwritten?

Wilcov commented 3 months ago

I found out that the issue was caused by some config of my wezterm terminal. After removing ~/.local/share/wezterm Neomodern now work properly when starting Neovim every time.

Sorry for opening the issue here, i used catppuccin before and that had no issues with my wezterm so i figured it might be something in Neomodern.

I'll close this issue later today. Thanks for your help! I really love the darkforest version of the colorscheme.

Wilcov commented 3 months ago

So i found the cause of the issue, or atleast the specific config settings that enable the behavior: 1) i use wezterm, release 20240203-110809-5046fc22 (latest) with the following config in the ~/.wezterm.lua file

local wezterm = require 'wezterm'

-- This will hold the configuration.
local config = wezterm.config_builder()

-- This is where you actually apply your config choices

-- For example, changing the color scheme:
config.color_scheme = 'daylight'
-- config.color_scheme = 'AdventureTime'
-- and finally, return the configuration to wezterm
return config

If you switch the config.color_scheme of Wezterm to any of the Neomodern wezterm colorschemes (i've copied them to ~/.config/wezterm/colors which get automatically recognized) then it overwrites the Neovim colorscheme.

I.e. If you have darkforest defined in the init.lua Neovim config file but set daylight as the wezterm colorscheme Neovim also displays the daylight version of Neomodern

cdmill commented 3 months ago

Hmm I haven't used wezterm so maybe I'll download it and see if I can't identify what's happening there. I'll update you if I get it fixed here in the next day or two. Thanks!

cdmill commented 3 months ago

@Wilcov could you share an image of what your colors look like in wezterm? Because my highlighting looks as expected if I use daylight for wezterm and darkforest for neovim. Note that the padding isn't setup for wezterm so the white from daylight is showing in the image below. the only thing is you might need to change the cursor color since it is set to black for daylight

sc 2024-06-11 at 20 02 56
Wilcov commented 3 months ago

That's strange, i've added two screenshots

This first one has both darkforest configured for wezterm and neovim

Scherm­afbeelding 2024-06-12 om 09 44 39

The second one has darkforest configured for Neovim but daylight for Wezterm. I also noted that you load your theme lazy without the priority setting so i tried that as well but it didn't fix anything. (the instructions on the github readme include the lazy = false and priority settings)

Scherm­afbeelding 2024-06-12 om 09 45 16

It's starting to look like the issue might be local to my systems (the issue is both on my macbook and linux dekstop) but i have no idea what's wrong.

cdmill commented 3 months ago

The lazy = false and priority = 1000 are included in the readme but they're not necessarily required just recommended or at least used in the readme to highlight that you shouldn't lazy load your colorscheme.

It's hard to say what the issue is without looking at your dotfiles. I'm sorry I'm not really able to be of help further than that. You could try my neovim config and if the issue goes away than we can isolate it to your neovim config and see where to go from there.

cdmill commented 3 months ago

Closing -- unable to determine source of issue. Please reopen if there are any further updates!