Shatur / neovim-ayu

Ayu theme for Neovim.
GNU General Public License v3.0
416 stars 42 forks source link

Overriding is not working #3

Closed mroavi closed 3 years ago

mroavi commented 3 years ago

Hi there. Could you help me figure out why overriding highlights is not working in my setup?

This is how I load your package:

use {'Shatur/neovim-ayu', config = function() require('mrv.plugins.ayu') end} -- Ayu theme for Neovim

and inside my config file mrv.plugins.ayu I have:

vim.g.ayu_mirage = false

local colors = require('ayu.colors')

vim.g.ayu_overrides = {
  LineNr = {fg = colors.white}
}

vim.cmd [[ colorscheme ayu ]]

Thanks for your time!

Shatur commented 3 years ago

Thanks, now should work, I just made a typo :)

LoveSponge commented 2 years ago

Overriding still seems to not be working if the variable wasn't declared before? I'm trying to override TreeSitter faces:

require('ayu').setup({
  mirage = true,
  overrides = {
    TSInclude = { fg = colors.tag },
    IncSearch = {fg = '#FFFFFF'}
  }
})

IncSearch seems to work, but not TSInclude...

Shatur commented 2 years ago

Overriding still seems to not be working if the variable wasn't declared before?

It works, you can specify new values. Just tested, the new TSInclude appears. Try debugging using so $VIMRUNTIME/syntax/hitest.vim.

benewberg commented 2 years ago

Please excuse me further commenting on a closed issue, but the only way I've been able to make the color overrides work (using the colors from the colorscheme as opposed to the hexadecimal colors) is to do the following:

local colors = require('ayu.colors')
colors.generate(true)  -- this is where the "fix" is; true because I want mirage
require('ayu').setup({
  mirage = true,
  overrides = {
    TSInclude = {fg = colors.tag},
    IncSearch = {fg = '#FFFFFF'}
  }
})
require('ayu').colorscheme()

The colors.generate gets called in the call to colorscheme(), but I can't call that before the setup() otherwise it won't honor the overrides. Thus this is the other option:

require('ayu').colorscheme()  -- call before and after the setup
local colors = require('ayu.colors')
require('ayu').setup({
  mirage = true,
  overrides = {
    TSInclude = {fg = colors.tag},
    IncSearch = {fg = '#FFFFFF'}
  }
})
require('ayu').colorscheme()

Perhaps I am doing something incorrect, which necessitates the above?

LoveSponge commented 2 years ago

@benewberg - confirmed putting this line applies the desired colours.

Shatur commented 2 years ago

@benewberg you are right,you need to call generate first. I will add this to readme.