Skip to content

Is there a way to change the inlay hint color? #111

Open

Description

@tubzby

I'm using nvim with rust-analyzer, the text ": Cli" and ": u16" are inlay hint texts.
image

I prefer grey color for 'inlay hint color', is there a way to do that?

Activity

  1. saccarosium commented on Dec 22, 2022

    @saccarosium
    Contributor

    Can you give some more information, such as:

    • Neovim or vim?
    • If neovim are you using treesitter?

    If you are using neovim and treesitter you could use treesitter-playgroud to see what highlight grop the thing you want to change, and then use hi! <highlight> guifg=<color> guibg=<color> to change the highlight.

  2. tubzby commented on Dec 24, 2022

    @tubzby
    Author

    I'm using Neovim 0.8.1 without treesitter.

  3. tomasiser commented on Jan 2, 2023

    @tomasiser
    Owner

    Hi there, I think you will need to follow the advice above and try to figure out which highlight group that hint texts are. Once you know, you can try editing the colors for that specific highlight group. Unfortunately, it might happen that they share the same group with another syntax, in which case it'll be hard to differentiate them in vim.

  4. pattop commented on Jan 6, 2023

    @pattop

    @tubzby assuming you're using rust-tools you can set the highlight group for the inlay e.g.

    local rust_opts = {
    	tools = {
    		inlay_hints = {
    			highlight = "rustInlayHint",
    		},
    	},
    }
    require('rust-tools').setup(rust_opts)
    

    Then you can set the colour as normal, e.g.:

    highlight rustInlayHint ctermfg=235
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions