EdenEast / nightfox.nvim

🦊A highly customizable theme for vim and neovim with support for lsp, treesitter and a variety of plugins.
MIT License
3.05k stars 138 forks source link

Question: How To Override The NonText Color? #159

Closed jtw023 closed 2 years ago

jtw023 commented 2 years ago

I am using the terafox colorscheme with zero alterations to it, what is the best way to go about changing only the NonText color? I've tried changing it a few times now but nothing seems to work. Also, I am not using the gui version of neovim even though guifg the only thing with a color set for NonText. Is it possible that I need to add a color instead of overriding an already existing color?

2022-05-20_22-15 2022-05-20_22-16

EdenEast commented 2 years ago

The highlight group that you are looking for is Whitespace (:help hl-Whitespace). You can override this using groups. See readme for more examples of using groups.

I recently updated Whitespace's value from bg2 to bg3. This make it stand out slightly more from the background. Here is an example of me overriding Whitespace:

require('nightfox').setup({
  groups = {
    all = {
      -- Make sure to only define *one* Whitespace key. This is just some examples...
      Whitespace = { fg = "bg4" }, -- Slightly increase the contrast color from the base `bg3` color
      Whitespace = { fg = "palette.blue" }, -- Set it to the palette's base blue color
      Whitespace = { link = "LineNr" }, -- Link to the value of the line numbers
    }
  }
})
jtw023 commented 2 years ago

Thank you! One thing to note, I couldn't get it working in the setup function. Ended up changing .config/nvim/autoload/plugged/nightfox.nvim/lua/nightfox/precompiled/nvim/terafox_compiled.lua and then commenting my setup function so that I know which file to change if it ever stops working.

setup function in .config/nvim/lua/plug-nightfox.lua 2022-05-21_23-15

terafox_compiled.lua 2022-05-21_23-05

EdenEast commented 2 years ago

Looking at your config you have an ordering issue.

source $HOME/.config/nvim/vim-plug/plugins.vim
source $HOME/.config/nvim/options.vim " <---Setting the colorscheme to terafox here
" ...
lua require'plug-nightfox' " <--- Calling the setup function to override the colors

Make sure that you have called the setup function before setting the colorscheme so that the changes will be applied.

jtw023 commented 2 years ago

Fixed it! I didn't realize the ordering was such a big part. Thank you so much for going above and beyond!