lalitmee / cobalt2.nvim

cobalt2 theme for neovim in Lua using colorbuddy
https://github.com/lalitmee/cobalt2.nvim
MIT License
105 stars 13 forks source link

Installation steps #9

Closed Lixeiden closed 10 months ago

Lixeiden commented 1 year ago

Hello Friend! I'm novice with neovim. I have readed README.md but still have a trouble with installation.

Where is this code to apply?

use { 'lalitmee/cobalt2.nvim', requires = 'tjdevries/colorbuddy.nvim' }

I've putted this to my ~/.config/nvim/init.lua:

require('colorbuddy').colorscheme('cobalt2')

and have putted colors and lua dirs from your repo and lua dir from tjdevries/colorbuddy to ~/.config/nvim/

Maybe I miss something?

lalitmee commented 1 year ago

@Lixeiden, you just need to install the colorscheme using this:

and then just put this somewhere in your config and it should work:

require('colorbuddy').colorscheme('cobalt2')

You don't need to put anything else from anywhere.

Atreyu-94 commented 1 year ago

With Lazy, you need to put:

return {
  "lalitmee/cobalt2.nvim",

  dependencies = {
    lazy = false,
    "tjdevries/colorbuddy.nvim",
  },
--  {
--    "LazyVim/LazyVim",
--    opts = {
--      colorscheme = "cobalt2",
--    },
--  },
--}

.. and with LazyVim:

return {
  "lalitmee/cobalt2.nvim",

  dependencies = {
    lazy = false,
    "tjdevries/colorbuddy.nvim",
  },
  {
    "LazyVim/LazyVim",
    opts = {
      colorscheme = "cobalt2",
    },
  },
}

This is because dependencies are charged with lazy = true by default, so colorbuddy is not charged at startup, and cobalt2 doesen't load. I think this option should be on Readme explained for Lazy :)

lalitmeeq commented 1 year ago

@Atreyu-94 and @Lixeiden, I am also using lazy.nvim and I am installing cobalt2.nvim like the following:

return {
    "lalitmee/cobalt2.nvim",
    event = { "ColorSchemePre" }, -- if you want to lazy load
    dependencies = { "tjdevries/colorbuddy.nvim" },
    init = function()
        require("colorbuddy").colorscheme("cobalt2")
    end,
}

And it works without any issues.

jellydn commented 1 year ago

Mine is with LazyVim, it works fine.

return {
  {
    "lalitmee/cobalt2.nvim",
    dependencies = { "tjdevries/colorbuddy.nvim" },
    config = function()
      require("colorbuddy").colorscheme("cobalt2")
    end,
  },
  {
    "LazyVim/LazyVim",
    opts = {
      colorscheme = "cobalt2",
    },
  },
}
Jonak-Adipta-Kalita commented 1 year ago

Possible to install with VimPlug? for Neovim

lalitmee commented 1 year ago

Possible to install with VimPlug? for Neovim

It should be easy to install with Plug. Just replace the keys with what Plug has.

Plug "tjdevries/colorbuddy.nvim"
Plug "lalitmee/cobalt2.nvim"

after this

Try it.

Jonak-Adipta-Kalita commented 1 year ago

Possible to install with VimPlug? for Neovim

It should be easy to install with Plug. Just replace the keys with what Plug has.

Plug "tjdevries/colorbuddy.nvim"
Plug "lalitmee/cobalt2.nvim"

after this

  • init.lua
require("colorbuddy").colorscheme("cobalt2")
  • init.vim
lua require("colorbuddy").colorscheme("cobalt2")

Try it.

Alright Thanks, I will try it

Jonak-Adipta-Kalita commented 1 year ago

Everything is working Correctly, but why is there Black in the sides? image

lalitmee commented 1 year ago

Everything is working Correctly, but why is there Black in the sides? image

That is your terminal theme, you will need to set your terminal theme to cobalt2 if you don't want that black lines on the side

KenJean commented 1 year ago

Hello there,

Just switched from neovim to lunarvim and am desperately trying to get cobalt2 to load. I've tried every single configuration from above and all I can get is a listing for cobalt2 in the choice for colours, but the colour itself does not load.

lunarvim uses packer as a plug-in loader.

Any ideas ?

⇒ KJ

lalitmee commented 1 year ago

@KenJean, please provide the configuration you are trying. And also provide the documentation for lunarvim colorschemes loading. I haven't used lunarvim, so no idea.

KenJean commented 1 year ago

Thanks for the quick response. Here's how one loads a plug-in in lunarvim. The config file is ~/.config/lvim/config.lua:

lvim.plugins = {
 {
   'lalitmee/cobalt2.nvim',
   dependencies = 'tjdevries/colorbuddy.nvim'
 },
}
lvim.colorscheme = 'cobalt2'

The plugin manager is packer though, as you can see, they use a slightly different syntax. As I mentioned before, I have tried all the other variants from above inside the lvim.plugins = {} block.

What I notice now is that the status bar does change to cobalt2, but not the text inside in the editor. This gives me a bad feeling for it looks like your cobalt2 theme does load but lunarvim doesn't know how to handle it.

I guess I'm out of luck if I want to stick with lunarvim.

⇒ KJ

lalitmee commented 1 year ago

@KenJean, You are right, I think lunarvim doesn't have the mechanism to apply the color schemes which are not used directly. So it would be best if you did it manually.

You can still do this. As it's clearly mentioned in the README do it to use the color scheme.

require('colorbuddy').colorscheme('cobalt2')

If not, I suggest you try this after loading the color scheme and I am sure it will work.

KenJean commented 1 year ago

Oh yeah !!!! That works a treat !

The trick, at least in my case in lunarvim, is to invoke that extra 'require' line only after loading the colorscheme - exactly as you suggested. I was doing it before, which didn't do the trick.

Many thanks for you help. I am eternally grateful.

⇒ KJ

lalitmee commented 1 year ago

@KenJean, I am glad it worked out.