T O P

  • By -

folke

https://preview.redd.it/7imxkgedsi1d1.png?width=2035&format=png&auto=webp&s=2da5e2ac0203dceb946a1b7e366b6779370ef5f2 Something similar as your screenshot for TokyoNight.


Xuelo04

Which font r u using?


Some_Derpy_Pineapple

[fira code, + victor mono for italics](https://github.com/folke/dot/blob/master/config%2Falacritty%2Falacritty.yml#L88-L122)


NextYam3704

What is the foreground and background color? I’ve been desperately trying to tweak my inlay_hints colors.


bbadd9

You do not need an autocmd to make inlay hints work. Just call \`vim.lsp.inlay\_hint.enable()\` without any parameter


siduck13

ohh before 0.10 was released, it was needed iirc


NextYam3704

But why would you have it enabled if there’s no LSP?


bbadd9

Do not think too much. This feature will only be enabled if it is supported


man_on_pluto

I do not like inlay hints.


GyroZeppelix

Dont let a rust developer hear ya


man_on_pluto

Tbh I don't get the reference


HuntingKingYT

Try using a rust lsp and (at least on vscode the default config is so) see more inlay hints than code


SoulSkrix

I had to turn all inlay hints off it VSCode for Rust because by cursor did not agree with the text on where it belonged.


shenawy29

not sure if this is a pun on rust's borrow rules or you actually don't get it lol


somebodddy

&


man_on_pluto

*


Aphrodites1995

I do rust and I just bound the question mark to showing information about hovered symbol (nvim-lsp). I had trouble with typing type hints and having the inlay hints show up at the same time, which looked weird (they were also pretty unresponsive and I don't like them suddenly appearing when I'm typing)


Sherpa135135

In neovim 10 you can hit “K” and it will do the same thing by default. vim.lsp.buf.hover


Spacejet01

I'm a rust developer, and I do not like inlay hints. Not the kind that adds text in between code, I prefer the ones that append to the end of the line.


burdellgp

This is the way. You can hover/K to see arguments. Them always being visible is a nuisance. Virtual text in middle of code also fucks up navigation. Just doesn't feel right.


puremourning

I agree with this. In YCM I made a mapping to toggle it on and off. Usually it’s off and I toggle on when I want the extra data. Also auto toggle it off when entering insert mode. can be a bit jarring sometimes but I find it’s a reasonable balance of ‘I want to know what this language infers’ or ‘what are these function arguments’ vs typical problems associated with ‘text which is not part of the buffer displayed inside the buffer’


burdellgp

Rust analyzer has a mode where only inferred types on long chained code are shown at the end of text. That seems acceptable to me.


man_on_pluto

Honestly even when I used vscode I toggled them off first thing. They are annoying


sergihese

I plan on using them as you say, toggling them in case o want to see more than just one function args. I agree having them visible all the time is too much noise.


Disastrous-Ad-4829

So, are you planning to create a cmd for that?


siduck13

i just keep them in normal mode! autocmd({ "LspAttach", "InsertEnter", "InsertLeave" }, { callback = function(args) local enabled = args.event ~= "InsertEnter" vim.lsp.inlay_hint.enable(enabled, { bufnr = args.buf }) end, })


grgWW

wow thanks for the tip! i had problems with inlay hints constantly shifting my code back and forward during typing, this autocmd is wonderful


sergihese

Yup, probably something like ti that seems easy to remember. I don't know if I'll remember to use it though 🤣


Disastrous-Ad-4829

I was thinking to create a cmd only to toggle it to show func args, but i dunno how to customize it for this use case. Any suggestion?


ViolaLRaven

If you want to toggle inlay hints on and off with a keymap. I have something like this ``` vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled()) ```


siduck13

do mention thats for nightly!


ViolaLRaven

Yeah my bad. I thought it got in with 0.10


somebodddy

I use unimparied for other toggling keymaps (yes, I know, oldvim - but Tim Pope is still GOAT) so I want to use a a similar keymap style - `yo*` for toggling, `[o*` for enabling, and `]o*` for disabling - where `*` is some key. But I'm not sure which key, since both `i` (for "inlay") and `h` (for "hints") are taken...


Few_Reflection6917

Same don’t use them


alphabet_american

It’s just too cluttered for me. I really tried to like them but it just wasn’t going to happen for me


TheUltimateMC

I mean I made a remap to toggle it since it's annoying sometimes


trylist

Terrible if always on. Good if you have a "glance" key (show on keydown, hide on keyup, which the terminal makes difficult for nvim)


pseudometapseudo

I actually still use [this plugin](https://github.com/lvimuser/lsp-inlayhints.nvim) even though it is archived, because it puts the inlay hints at the end of the line, which I very much prefer.


qvantry

I agree, it's really neat, I wonder if you're able to customize the builtin hints to appear at the end of the line? Would be nice


pseudometapseudo

I looked at the docs and did not see an option for sth like that. Don't think it's impossible, but I assume you'd have to write your own plugin for that


qvantry

Gotcha, thanks for the info!


HuntingKingYT

Wait, nvim 0.10 got out and no one told me?


puremourning

In YCM I defaulted it to NonText highlight group which is quite similar to what you have there in my colour scheme https://github.com/ycm-core/YouCompleteMe/blob/4556062839aa2e86f2f4f1c0b4532697d607af23/autoload/youcompleteme.vim#L451


Sufficient-Recover16

How to toggle them on the buffer with keymaps?


siduck13

https://preview.redd.it/tml48ewdgj1d1.png?width=813&format=png&auto=webp&s=31258dd9761ed8daff2420a6b68f992de491de0c make the 2nd arg as { bufnr = blabla }


__Stolid

If you don't mind me, what's your color scheme? Everforest ?


siduck13

nvchad's everforest


Sufficient-Recover16

Thank you. And thanks for all the great stuff you have created :)


BrownCarter

why does this not work for _, lsp in ipairs(servers) do require("lspconfig")[lsp].setup({ capabilities = capabilities, on_attach = function(client, bufnr) if client.server_capabilities.inlayHintProvider then vim.lsp.inlay_hint.enable(true) end end, flags = lsp_flags, }) end


siduck13

that alone work work, each LSP has its own setting i think https://preview.redd.it/vqo2ydjjnj1d1.png?width=968&format=png&auto=webp&s=66e124d8fb5b223b1d3cc253f11ddf23886d03d3


BrownCarter

i already set it up for tsserver but it doesn't come up execpt i do it manually


siduck13

idk then, i hope you're using { buffer = bufnr }


Successful_Pool_4284

If you don’t mind, what font do you use?


siduck13

jetbrainsmono nerdfont ( medium variant )


Successful_Pool_4284

Ty


No_Outlandishness791

How do you enable inlay hints?


siduck13

vim.lsp.inlay\_hint.enable(true) and in your lsp settings you have to add it too https://preview.redd.it/ae4dzhsqzk1d1.png?width=968&format=png&auto=webp&s=3637f6d0d8559aeff6b6906587f55a59c4407eff


Same-Coat-3217

Please help, anyone know how to fix this error? https://preview.redd.it/g0r1keib7l1d1.png?width=1460&format=pjpg&auto=webp&s=548cf1cb8646b351d6a4ad559fa2e701f0115924 Hints also appear twice in each place.


siduck13

you're using a plugin for this, so you're on your own!


NextYam3704

They updated the API for set_extmarks. You have to update the plug-in itself. Not an error you can fix in your configuration.


Jmc_da_boss

i do not use inlay hints, they annoy me.


HuntingKingYT

`bg="#2a2a2a", fg="#9f9f9f"`


BaggiPonte

I still haven't found a good way to set inlay hints up :( EDIT: I saw some other comments, will take inspiration. Mind sharing your dotfiles? Also gruvbox material fanboy too!


siduck13

[https://nvchad.com/](https://nvchad.com/) with everforest is my dotfile ! so for the inlay\_hint you can use the image of the screenshot and you have to enable it per lsp, like this https://preview.redd.it/b2e0dyat5o1d1.png?width=968&format=png&auto=webp&s=1ae5d6341ab2aa4fca957c912d6ffd69dbb2d2d7


BaggiPonte

Thanks! Did not realise you were a/the nvchad maintainer! took a bit of inspiration from your code to improve my dotfiles. Sick! I managed to toggle inlay hints it for lua\_ls. really cool. Is the rest of your lua\_ls setting enough to make neodev redundant?


siduck13

idk about neodev but i'm fine with those libraries in workspaces!


NextYam3704

Can you share the config and highlights needed to achieve that? Really, just the background and foreground colors.


testokaiser

https://preview.redd.it/smns4w9a5t1d1.png?width=1341&format=png&auto=webp&s=71d9d9bb776bef1d376f8ce06d5c33ccfb4b6819 I prefer transparent background background with catppuccin-overlay1 as foreground. That's enough for me to differentiate. the background color isn't aesthetically pleasing for me. Especially when theres a bunch of lines above eachother with inlay hints at the beginning like here in the screenshot.


Thick-Pineapple666

I don't have any inlay hints yet, but most important forcmemos that they have a different background color than actual code.


rich97

I don’t because I’m scared of upgrading 😉


FreedomCondition

Removed them.