jesseleite / nvim-noirbuddy

🖤 A highly customizable minimalist theme building framework
346 stars 15 forks source link

How do i use it with a Neovim distro like LazyVim? #12

Open rin-yato opened 11 months ago

rin-yato commented 11 months ago

So lazyvim uses the tokyonight by default and when i disabled tokyonight and use noirbuddy instead the problem is that i can not make lazyvim use the preset.

--------------------------------------------------------------------------------
-- Noirbuddy: A highly customizable minimalist monochromatic colorscheme
--------------------------------------------------------------------------------

return {
    {
        "jesseleite/nvim-noirbuddy",
        dependencies = {
            { "tjdevries/colorbuddy.nvim", branch = "dev" },
        },
        lazy = true,
        priority = 1000,
        opts = {
            preset = "miami-nights",
            styles = {
                italic = true,
                undercurl = true,
                bold = false,
            },
        },
    },
    { "LazyVim/LazyVim", opts = { colorscheme = "noirbuddy" } },
}

how do i tell lazyvim to use the miami-nights preset?

thank you beforehand for any help

enzime4u commented 11 months ago

I have the same issue with the slate preset :

return {
  "jesseleite/nvim-noirbuddy",
  dependencies = {
    "tjdevries/colorbuddy.nvim",
    branch = "dev",
    lazy = false,
    priority = 1000,
  },
  config = function()
    require("noirbuddy").setup {
     preset = "slate",
    }
    vim.cmd.colorscheme "noirbuddy"
 end,
}
jesseleite commented 10 months ago

@rin-yato Check the readme for lazy.nvim, you must have lazy = false for this plugin.

@enzime4u Also check readme, you shouldn't nest lazy or priority settings on the colorbuddy dependency, but rather on noirbuddy itself. You also shouldn't need to set vim.cmd.colorscheme "noirbuddy".

Here's how we're recommending you setup in readme...

CleanShot 2024-01-04 at 19 39 03

Hope it helps! ❤️

rin-yato commented 10 months ago

@jesseleite I actually followed the doc shown but it didnt work either, I also tried changing the priority but that still didnt do anything. The problem that i have is that I need to include this line

{ "LazyVim/LazyVim", opts = { colorscheme = "noirbuddy" } }

otherwise lazyvim will fallback to tokyonights, but when i add that line it seems to override the other config and uses the minimal preset instead.

jesseleite commented 10 months ago

Oh interesting. Never tested with a NeoVim 'distro' like LazyVim. Misread the issue title and thought you meant lazy.nvim (the package manager). Will look into!

emielvangoor commented 9 months ago

Any progression on this? I'm experiencing the same thing with LunarVim, it uses lazy. I have the following config and trying to set the slate preset but it does not work:

image
rin-yato commented 9 months ago

Any progression on this? I'm experiencing the same thing with LunarVim, it uses lazy. I have the following config and trying to set the slate preset but it does not work:

image

So i forked the repo and make it so that it always load one preset, then i just install the plugin from my repo instead. But I still had some problem with using miami-nights, the some reason the light cyan color doesnt work well, other than that the preset loads fine.

emielvangoor commented 9 months ago

Any progression on this? I'm experiencing the same thing with LunarVim, it uses lazy. I have the following config and trying to set the slate preset but it does not work:

image

So i forked the repo and make it so that it always load one preset, then i just install the plugin from my repo instead. But I still had some problem with using miami-nights, the some reason the light cyan color doesnt work well, other than that the preset loads fine.

Thanks for the tip!

jesseleite commented 9 months ago

Sorry I haven't had time to pull LazyVim and try this myself yet. Will leave this issue open until I / someone can help pinpoint the problem!

So i forked the repo and make it so that it always load one preset

Also, @rin-yato can you share your fork so I can take a look at your changes?

n1ghtmare commented 9 months ago

I can't reproduce the issue either. If someone can post their dotfiles, I could take a look. I suspect somewhere people might be doing vim.cmd.colorscheme = "noirbuddy" (which isn't needed), maybe?

xvzzwlknoranb commented 8 months ago

I ran into the same issue using kickstart.nvim (not technically a distro, but also uses lazy.nvim) and the only way to make it work for me was to use a priority value lower than the default (less than 50). I have no idea why it works that way, but maybe the information will be useful to you.

return {
    'jesseleite/nvim-noirbuddy',
    dependencies = {
        { 'tjdevries/colorbuddy.nvim' }
    },
    lazy = false,
    priority = 49,
    opts = {
        preset = 'slate',
    },
}
jesseleite commented 8 months ago

@monita-hungara-13 Might depend on if other plugins have priorities set? Will try with kickstart.nvim soon. Thanks for the info!

xvzzwlknoranb commented 8 months ago

@jesseleite I just found the reason😅. I use transparent.nvim, and it seems to internally reset the current colorscheme every time transparency is enabled/disabled. Which causes noirbuddy to go back to the default preset. In my case, I just rearranged the priorities in my config so that the transparent.nvim change happens before setting the colorscheme.

I assume the same conflict can occur with any plugin that sneakily sets the colorscheme.

jesseleite commented 7 months ago

@monita-hungara-13 Oh interesting, that makes a lot of sense. Priorities are going to differ based on peoples' varying plugin setups, so maybe I should document this somehow. Thanks for reporting back on this btw!

PS. Not totally relevant, but what OS are you on? @n1ghtmare and I have noticed some difference between Mac and Linux for example, in regards to manually calling colorscheme (at least on an earlier version of noirbuddy), so I'm just curious.

ishwar00 commented 7 months ago

I use Lunarvim I had same issue, following worked for me. But reloading LunarVim causes the same problem. check this out as well.

lvim.colorscheme = "noirbuddy"

require('noirbuddy').setup {
  preset = 'miami-nights',
}

lvim.plugins = {
  {
    'jesseleite/nvim-noirbuddy',
    dependencies = {
      { 'tjdevries/colorbuddy.nvim' }
    },
    lazy = true,
    opts = {
      preset = 'miami-nights',
    },
  }
}
ernstwi commented 7 months ago

Although this is not the correct solution, I found this to work with LazyVim:

return {
  {
    "jesseleite/nvim-noirbuddy",
    dependencies = {
      { "tjdevries/colorbuddy.nvim" },
    },
    lazy = false,
    priority = 1000,
  },
  {
    "LazyVim/LazyVim",
    opts = {
      colorscheme = function()
        require("noirbuddy").setup({
          -- Options here:
          preset = "crt-green",
        })
      end,
    },
  },
}

Also, calling set background=dark|light resets the colors to noirbuddy defaults, so your config should not set background.

yrammos commented 6 months ago

Using plain lazy.nvim (not the LazyVim) distro, I find it necessary to :Lazy reload nvim-noirbuddy manually after launching nvim. Might anyone know why? Here is my spec:

return {
  'jesseleite/nvim-noirbuddy',
  dependencies = {
    { 'tjdevries/colorbuddy.nvim' },
  },
  lazy = false,
  priority = 1000,
  opts = {
    preset = 'crt-green',
  },
  init = function()
    vim.cmd.colorscheme 'noirbuddy'    
  end,
}
paiman-nassan commented 3 months ago

@yrammos

Using plain lazy.nvim (not the LazyVim) distro, I find it necessary to :Lazy reload nvim-noirbuddy manually after launching nvim. Might anyone know why? Here is my spec:

return {
  'jesseleite/nvim-noirbuddy',
  dependencies = {
    { 'tjdevries/colorbuddy.nvim' },
  },
  lazy = false,
  priority = 1000,
  opts = {
    preset = 'crt-green',
  },
  init = function()
    vim.cmd.colorscheme 'noirbuddy'    
  end,
}

removing vim.cmd.colorscheme 'noirbuddy' should solve the problem

n1ghtmare commented 2 months ago

So I think @chiefnoah found out the issue and we added a notice to the readme, https://github.com/jesseleite/nvim-noirbuddy/pull/17

Can you guys check and see if following the notice solves your issue?

ficcdaf commented 3 weeks ago

I was able to get around it with the following configuration:

local noiropts = {
  preset = "miami-nights",
}
return {
  {
    "jesseleite/nvim-noirbuddy",
    lazy = false,
    dependencies = {
      { "tjdevries/colorbuddy.nvim" },
    },
  },
  {
    "LazyVim/LazyVim",
    opts = {
      colorscheme = function()
        require("noirbuddy").setup(noiropts)
      end,
    },
  },
}

The point is to pass a function that calls require("noirbuddy").setup(opts) as the colorscheme for LazyVim, instead of just setting it to a string. I don't know if it really changes anything, but I also explicitly disable TokyoNight elsewhere in my config.