EdenEast / nightfox.nvim

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

Question: How to custom inlayhints bg color and fg color #350

Open IWANABETHATGUY opened 1 year ago

IWANABETHATGUY commented 1 year ago

According to this pull request, https://github.com/EdenEast/nightfox.nvim/pull/205/files#diff-47d639f17cdad63995941eae4c5fe0a07b271cc889c9973a6357aa276f9dae07R19, inlay hints fg is always same as comments , image It is pretty hard to read if I want a green comments color

EdenEast commented 1 year ago

You can override the highlight group LspInlayHint.

require("nightfox").setup({
  groups = {
    all = {
      LspInlayHint = { fg = "fg3" },
    },
  },
})

You can find more info on the palette and spec

IWANABETHATGUY commented 1 year ago

Seems not working

-- Default options
require('nightfox').setup({
  options = {
    -- Compiled file's destination location
    compile_path = vim.fn.stdpath("cache") .. "/nightfox",
    compile_file_suffix = "_compiled", -- Compiled file suffix
    transparent = false,               -- Disable setting background
    terminal_colors = true,            -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal`
    dim_inactive = false,              -- Non focused panes set to alternative background
    module_default = true,             -- Default enable value for modules
    colorblind = {
      enable = false,                  -- Enable colorblind support
      simulate_only = false,           -- Only show simulated colorblind colors and not diff shifted
      severity = {
        protan = 0,                    -- Severity [0,1] for protan (red)
        deutan = 0,                    -- Severity [0,1] for deutan (green)
        tritan = 0,                    -- Severity [0,1] for tritan (blue)
      },
    },
    styles = {
      comments = "NONE", -- Value is any valid attr-list value `:help attr-list`
      conditionals = "NONE",
      constants = "NONE",
      functions = "NONE",
      keywords = "NONE",
      numbers = "NONE",
      operators = "NONE",
      strings = "NONE",
      types = "NONE",
      variables = "NONE",
    },
    inverse = {
      -- Inverse highlight for different types
      match_paren = false,
      visual = false,
      search = false,
    },
    modules = {
      -- List of various plugins and additional options
      fidget = true,
    },
  },
  palettes = {
    nordfox = {
      -- -- comment is the definition of the comment color.
      comment = "#83b260",
    },

  },
  specs = {},
  groups = {
    nordfox = {
      LspInlayHint = { fg = "red" },
    }
  },
})

-- setup must be called before loading
vim.cmd [[colorscheme nordfox]]

This is my config, image This is the screenshot after apply this config, you could see inlay is still same as comments.

EdenEast commented 1 year ago

The override for group is incorrect. It should be:

LspInlayHint = { fg = "palette.red" },

Refer to readme for more information.

IWANABETHATGUY commented 1 year ago

Still nothing change