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

Cursor Highlights being overriden by Lazyvim #151

Open
ankardo opened this issue Dec 2, 2024 · 4 comments
Open

Cursor Highlights being overriden by Lazyvim #151

ankardo opened this issue Dec 2, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@ankardo
Copy link

ankardo commented Dec 2, 2024

Description

I'm using Cyberdream with LazyVim and Im trying to make the cursor change to match the colors of the current vim mode..
Ex.:
Normal is blue, Insert is green, Visual is purple.
But adding nCursor, iCursor and vCursor in the highlights doesnt change the cursor color, I even tried to use the override function to override the highlights but still it didnt work.

Neovim version?

NVIM v0.10.2 Build type: Release LuaJIT 2.1.1713484068

What should happen?

The cursor would have different colors depending on what mode vim is.

What happened instead?

The cursor is white and no matter what I do it doesnt change.

Your configuration

return {
  "scottmckendry/cyberdream.nvim",
  lazy = false,
  priority = 1000,
  config = function()
    require("cyberdream").setup({
      transparent = true,
      italic_comments = true,
      terminal_colors = true,
      hide_fillchars = true,
      borderless_telescope = false,

      theme = {
        variant = "default",
        colors = customColors,
        highlights = {
          nCursor = { bg = customColors.blue, fg = customColors.black },
          vCursor = { bg = customColors.purple, fg = customColors.black },
          iCursor = { bg = customColors.green, fg = customColors.black },
          CursorLineNr = { fg = customColors.navajo, bold = true },
          Special = { fg = customColors.blue },
          SpecialKey = { fg = customColors.blue },
          Number = { fg = customColors.orange },
          Constant = { fg = customColors.cyan },
          Boolean = { fg = customColors.navajo, bold = true },
        },
      },
    })
    vim.cmd("colorscheme cyberdream")
  end,
}
@ankardo ankardo added the bug Something isn't working label Dec 2, 2024
@scottmckendry
Copy link
Owner

I'm not familiar with these highlight groups, is there some documentation you can point me to that explains some more about them?

@ankardo
Copy link
Author

ankardo commented Dec 2, 2024

It is mentioned in the options of the guicursor, gcr
https://neovim.io/doc/user/options.html
I was recently able to make it work by adding this to my options.lua

vim.opt.guicursor = {
"n:block-nCursor",
"i:ver25-iCursor",
"v:block-vCursor",
}

@scottmckendry
Copy link
Owner

I've been able to get this partially working with cyberdream using the following config:

return {
    "scottmckendry/cyberdream.nvim",
    lazy = false,
    priority = 1000,
    config = function()
        require("cyberdream").setup({
            theme = {
                overrides = function(colors)
                    return {
                        nCursor = { bg = colors.blue },
                        vCursor = { bg = colors.green },
                        iCursor = { bg = colors.red },
                    }
                end,
            },
        })

        vim.cmd("colorscheme cyberdream")
    end,
}

I say partially because Normal and Visual modes change the colour, but Insert mode still looks the same.

Have you changed anything else since this was last working? Terminal, etc? Can you still replicate the issue with a different colorscheme like tokyonight?

@scottmckendry scottmckendry added the waiting for op This issue is waiting for a response from the original poster label Dec 4, 2024
@ankardo
Copy link
Author

ankardo commented Dec 4, 2024

Well, it works fine if I dont use Cyberdream alongside LazyVim.
When I use it with LazyVim, it only changes when I change the cursor options explicitly using vim.opt.guicursor...
I tried to use the overrides function as well and it doesnt work either.

I made some tests with tokyonight with this configuration:
image

It seems that it doesn’t create the highlight groups properly, because even though you can see that they exist and the colors match the configuration, the cursor remains white no matter what, even when I set vim.opt.guicursor to use these highlight groups
image

@github-actions github-actions bot removed waiting for op This issue is waiting for a response from the original poster labels Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants