For anyone who followed this guide and had their stuff stop working on a newer nightly build, it looks like the api changed a little bit and now uses vim.lsp.inlay_hint.enable(). This is what I did to get it working again: if vim.lsp.inlay_hint then vim.keymap.set('n', 'nh', function() vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled(0)) end, { desc = "toggle inlay [h]ints" }) end
Thank you for the video. Not only you explain what configs to change but also why and how to change them, it is really helpful to newbies like me to understand Neovim and lua.
The tutorial is perfect. I was able to follow it and get inlay-hints to work for lua, js and ts files (after correcting the typos in my config file). Thanks, again.
This seems pretty slick, and is one of those little details that is super helpful, but has been missing from nvim. I don't typically use nightly builds, so I will probably just wait until it hits release status (hopefully soon).
Glad it was helpful! And yes, it can be handy for some code. I don't like having it on by default, but having a quick keymap to toggle it is sufficient for me, but some might choose to turn it on by default.
I love neovim, I just don't love trying to debug with it. Especially something like React Native. These inlay hints will help to read the new codebase at least, thanks :)
Thank you so much. One thing I found and it's very useful is this snippet that starts inlay hints automatically if your server has inlay hints capacity available: ```lua -- inside on_attach LSP function: -- ... if client.server_capabilities.inlayHintProvider then -- vim.api.nvim_set_hl(0, "LspInlayHint", { fg = "#747D83", bg = "#333232", italic = true }) -- Change inlayhints colors vim.lsp.inlay_hint(0, true) end ```
Nice, yeah I didn't cover custom highlighting... good tip. And good snippet for turning it on all the time. I hinted at it (pun intended) that LazyVim was doing that, but I didn't show the code (although maybe I should have) github.com/LazyVim/LazyVim/blob/a72a84972d85e5bbc6b9d60a0983b37efef21b8a/lua/lazyvim/plugins/lsp/init.lua#L127 Thanks for watching and the comment!
Awesome video. I wonder what is your daily driver for Neovim? Is your config based on Lazy or kickstarter? Maybe you use both since you have that script that you choose which one
Over the years I first started with my own config, then I switched to kickstart.nvim for a while, then I switched to LazyVim. For my primary for work at my day-job I use LazyVim, however, when I'm playing around with concepts on side projects or for TH-cam I flip between kickstart.nvim and LazyVim to make sure concepts work for both. I like the simplicity of kickstart.nvim and how close it is to a bare bones config.
Yay. Inlay Hints uses the "Virtual Text" feature of Neovim which is content that really isn't part of the buffer, so you can word hop over them (and skip over with motions) You currently need the nightly version of Neovim to use the feature. It will be part of the v0.10 release once it is launched.
Thanks for the video! The activity / progress of your LSP is displayed as an overlay in the bottom right of your screen. Would you please tell me how to get that?
Glad you liked it! The LSP progress is handled differently in kickstart.nvim and LazyVim. kickstart uses github.com/j-hui/fidget.nvim and LazyVim uses github.com/folke/noice.nvim and there is another option you could use called github.com/linrongbin16/lsp-progress.nvim
Yup, LazyVim and kickstart.nvim both have that keymap setup too (capital K). Good to know AstroNvim has it as well. I mention the keymap at the 41 second mark. It is a very helpful keymap as you mentioned. Thanks for watching
Hmm bummer, do you roll your own config or are you using some type of distro? Also, you'll need a nightly version for now until v0.10 is out (whenever that will be)
11 หลายเดือนก่อน
@@ElijahManor Nah, I'm downloading the github project and building it, I'm switching branches and testing, when I switch to the master branch it shows a warning about a deprecation from treesitter and nvim-ts-rainbow. But when I use the steps that you show in your video it screams error messages everywhere with other plugins, such as nvim-cmp for example. I switched to 0.9.2 because I care more for stability rather than bleeding edge. I'm using debian by the way
It's already setup! I meant to say that. Here is a link to the code github.com/LazyVim/LazyVim/blob/a72a84972d85e5bbc6b9d60a0983b37efef21b8a/lua/lazyvim/config/keymaps.lua#L116
Ah yes, you mean LazyVim v10.0.0? It is a very fast moving project github.com/LazyVim/LazyVim/blob/main/CHANGELOG.md I've been working on 2 other videos at various levels of completion, but I agree having a more up-to-date LazyVim video would be nice (or one that just covers the newest stuff from v10+). I'm tinkering with getting content ready for a Neovim v0.10 release as well (when it comes out) which is what I originally thought you meant when I first read your comment. Thanks for watching and for your continued interest :)
changed a bit again (neovim 0.10.0-prerelease): vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) -- toggle current buf, bool is the 1st arg
I don't use lunarVim, but it looks like this resource shows how you can configure a LSP www.lunarvim.org/docs/configuration/language-features/language-servers
Thanks! You can find kickstart.nvim here github.com/nvim-lua/kickstart.nvim It's a very streamlined config, a good starting point if you wanted to stay pretty light and maintain your own
10.8.1 (2023-11-30) Bug Fixes lsp: detect if using nvim-0.10 and use new inlay_hint.enable method (#2007) (6853b78) lsp: inlay hints on stable. See #2007 (e229988) ui: signcolumn signs on nightly. Fixes #2039 (11a8a6b)
Great video, thanks! However, this does not seem to work on September 23 with commit 93d27ea5 of the main branch built from source. There is no ":help" for "inlay_hint". Also, "vim.lsp.inlay_hint" does not exist. (However, a _field_ "_inlay_hint", note the underscore, does exist.) UPDATE: I works with commit c88bb65 that came as the nightly via Bob just few hours earlier. Strange...
Hmm odd, I've been using it for weeks. Not sure what was going on there. The following PRs added the functionality github.com/neovim/neovim/pull/23984 and github.com/neovim/neovim/pull/24074 Glad it's working for you now
wish there is a video and walk throught kickstart.nvim and add more feature to turn it into ide : ))) ( i always have problem with adding folding in nvim distro that dont have folding as default )
I do have an old high-level walkthrough of kickstart.nvim, but it was before they switched to lazy.nvim. I've been toying around with a series of videos that shows features from a very basic level... like not using LazyVim or NvChad or things like that. I like kickstart.nvim because it's still pretty low-level and simple and a good place to build upon
perf, that little snippet at 3:49 is just what i needed!
Good to see ya Elijah! Great video, looking forward to giving this a test drive. Also interested in a video on BOB!
Thanks man, appreciate you! And thanks for sharing your interest :)
This is definitely going to be one of my favorite nvim as an IDE features!
Awesome, great to hear!
For anyone who followed this guide and had their stuff stop working on a newer nightly build, it looks like the api changed a little bit and now uses vim.lsp.inlay_hint.enable(). This is what I did to get it working again:
if vim.lsp.inlay_hint then
vim.keymap.set('n', 'nh', function() vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled(0)) end, { desc = "toggle inlay [h]ints" })
end
Thanks so much !! Really loved that you even showed it for TS along with LazyVim config !
Glad it was helpful!
Thank you for the video. Not only you explain what configs to change but also why and how to change them, it is really helpful to newbies like me to understand Neovim and lua.
The tutorial is perfect. I was able to follow it and get inlay-hints to work for lua, js and ts files (after correcting the typos in my config file). Thanks, again.
Yay, glad it helped! Thanks for sharing
This seems pretty slick, and is one of those little details that is super helpful, but has been missing from nvim. I don't typically use nightly builds, so I will probably just wait until it hits release status (hopefully soon).
Glad it was helpful! And yes, it can be handy for some code. I don't like having it on by default, but having a quick keymap to toggle it is sufficient for me, but some might choose to turn it on by default.
Any info on this yet ?
A very useful keymap. Thank you!
Glad it was helpful!
Thanks for the great vid Elijah!
Thanks, glad you enjoyed it!
Diggin the content! Surprised I never encountered your channel before.
can't wait for it to make it to stable!
Yes, not sure when v0.10 is planned for, but hopefully soon :)
Thank's, excellent video as usual and also interested in video on bob.👏
Thanks! Been working on an outline for bob :)
Your videos helped me a lot, especially the ones about lazyvim
So glad, thank you for supporting the channel! Glad to get out another video. Hope you have a great rest of the week!
Thanks Elijah, have a great one too! 😄@@ElijahManor
Great content, I hope to see you more often!
Thanks, I hope you do too! 😀
Thanks for sharing. Yes, I'd like to learn how to use bob neovim version manager.
Awesome, good to know. It has been really helpful for me to try out new things, but switch to other versions as needed
It would be really helpful if you add a git gist with all the code of the config.
Doh, was in such a hurry to get it out I missed that. Thank you for bringing it up!
Here you go :) gist.github.com/elijahmanor/8a51534e108c96db740a2e93f9310cce
@@ElijahManor Thanks! That was quick.
I love neovim, I just don't love trying to debug with it. Especially something like React Native. These inlay hints will help to read the new codebase at least, thanks :)
nice!
Thank you! Hope you find it helpful
This feature will be very helpfull
Yes, it has been fun to use!
Great one, thank you!
Glad you liked it!
Thank you so much.
One thing I found and it's very useful is this snippet that starts inlay hints automatically if your server has inlay hints capacity available:
```lua
-- inside on_attach LSP function:
-- ...
if client.server_capabilities.inlayHintProvider then
-- vim.api.nvim_set_hl(0, "LspInlayHint", { fg = "#747D83", bg = "#333232", italic = true }) -- Change inlayhints colors
vim.lsp.inlay_hint(0, true)
end
```
Nice, yeah I didn't cover custom highlighting... good tip.
And good snippet for turning it on all the time. I hinted at it (pun intended) that LazyVim was doing that, but I didn't show the code (although maybe I should have) github.com/LazyVim/LazyVim/blob/a72a84972d85e5bbc6b9d60a0983b37efef21b8a/lua/lazyvim/plugins/lsp/init.lua#L127
Thanks for watching and the comment!
BOB 🙌
I'll start planning an outline. Thanks for the interest!
this is nice feature. thanks for the video. also interested in BOB the version manager :)
Glad you liked it and thanks for the interest! I'll need to plan an outline for that video. Seems to be of interest
Awesome. Thank you!!!
You are so welcome! Thanks for watching!
This have been in neovim for a couple of months now, and Intellij just announced this feature XD XD
It's been rolling out to numerous editors recently. Can be very handy
Awesome video. I wonder what is your daily driver for Neovim? Is your config based on Lazy or kickstarter? Maybe you use both since you have that script that you choose which one
Over the years I first started with my own config, then I switched to kickstart.nvim for a while, then I switched to LazyVim. For my primary for work at my day-job I use LazyVim, however, when I'm playing around with concepts on side projects or for TH-cam I flip between kickstart.nvim and LazyVim to make sure concepts work for both. I like the simplicity of kickstart.nvim and how close it is to a bare bones config.
Sweet 🎂!!
Thank you 😋
Elijah has returned! The inlay hint adds extra space at the beginning, any chance to remove it? What's the minimal version for this feature?
Yay. Inlay Hints uses the "Virtual Text" feature of Neovim which is content that really isn't part of the buffer, so you can word hop over them (and skip over with motions)
You currently need the nightly version of Neovim to use the feature. It will be part of the v0.10 release once it is launched.
wondering where you have gone, looking forwqrd to thr next video man
Configured, thank you really usefull
YAY!
Hey there! Love your videos....is there any way you could share your kitty config??? :)
Thanks for the video! The activity / progress of your LSP is displayed as an overlay in the bottom right of your screen. Would you please tell me how to get that?
Glad you liked it! The LSP progress is handled differently in kickstart.nvim and LazyVim. kickstart uses github.com/j-hui/fidget.nvim and LazyVim uses github.com/folke/noice.nvim and there is another option you could use called github.com/linrongbin16/lsp-progress.nvim
this is cool, btw what colorscheme is that
I'd love to see a video about the nvim version manager, also what's the best way to be on the latest version
Awesome, started on an outline last night
this video is great, I wondering what tool do you use to show your terminal in that way
I'm using tmux if that is what you mean. I use the catppuccin plugin for tmux to make it look a bit better... github.com/catppuccin/tmux
Show us the Bob
(Thank you for all you do for this community)
Thanks for the support! Working on an outline now :)
Hello, what are your thoughts on the new "/pmizio/typescript-tools.nvim" plugin? A faster alternative to the classic tssserver?
I should look into it, but haven't really played with it. Have you used it?
How do the inlay hints affect vim motions like w, e, b, etc?
Will they be skipped as if they aren't there?
Good question. The inlay hints feature uses virtual text, so motions just are skipped over... it's like the hints aren't even there!
Yes, I want the Bob Neovim config manager video. Pleeeeeeease! 🙂
I see... I use AstroNvim so Shift+k is what serves me the most, but I see this as great addition to that.
Yup, LazyVim and kickstart.nvim both have that keymap setup too (capital K). Good to know AstroNvim has it as well. I mention the keymap at the 41 second mark. It is a very helpful keymap as you mentioned. Thanks for watching
I don't have inlay_hint despite using sa,e version
Which font you use, bro?
its jetbrains mono. but i also recomended use monaspace neon.
how will this perform with copilot?
Couldn't test it, apparently is messing the config of other plugins, but it is a cool feature
Hmm bummer, do you roll your own config or are you using some type of distro? Also, you'll need a nightly version for now until v0.10 is out (whenever that will be)
@@ElijahManor Nah, I'm downloading the github project and building it, I'm switching branches and testing, when I switch to the master branch it shows a warning about a deprecation from treesitter and nvim-ts-rainbow. But when I use the steps that you show in your video it screams error messages everywhere with other plugins, such as nvim-cmp for example. I switched to 0.9.2 because I care more for stability rather than bleeding edge. I'm using debian by the way
Nice, thanks! How do I setup the shortcut in LazyVim?
It's already setup! I meant to say that. Here is a link to the code github.com/LazyVim/LazyVim/blob/a72a84972d85e5bbc6b9d60a0983b37efef21b8a/lua/lazyvim/config/keymaps.lua#L116
not working flutter/dart
Can you make a new video about lazyvim 0.10?
Ah yes, you mean LazyVim v10.0.0? It is a very fast moving project github.com/LazyVim/LazyVim/blob/main/CHANGELOG.md
I've been working on 2 other videos at various levels of completion, but I agree having a more up-to-date LazyVim video would be nice (or one that just covers the newest stuff from v10+).
I'm tinkering with getting content ready for a Neovim v0.10 release as well (when it comes out) which is what I originally thought you meant when I first read your comment.
Thanks for watching and for your continued interest :)
changed a bit again (neovim 0.10.0-prerelease): vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) -- toggle current buf, bool is the 1st arg
Anybody can help me to configure it for lunarVim
I don't use lunarVim, but it looks like this resource shows how you can configure a LSP www.lunarvim.org/docs/configuration/language-features/language-servers
that inlay hint looks disgusting, how can we do it rust style where it just lives on the right side without cluttering the screen
Loving your stock nvim! Moved in from LazyVim or just fun?
P.S. can you share the kickstarter we see on the video 🙏😁
Thanks! You can find kickstart.nvim here github.com/nvim-lua/kickstart.nvim It's a very streamlined config, a good starting point if you wanted to stay pretty light and maintain your own
The API has undergone similar changes. The interface has been changed from “ vim.lsp.inlay_hint” to “vim.lsp.inlay_hint.enable“.
10.8.1 (2023-11-30)
Bug Fixes
lsp: detect if using nvim-0.10 and use new inlay_hint.enable method (#2007) (6853b78)
lsp: inlay hints on stable. See #2007 (e229988)
ui: signcolumn signs on nightly. Fixes #2039 (11a8a6b)
Great video, thanks! However, this does not seem to work on September 23 with commit 93d27ea5 of the main branch built from source. There is no ":help" for "inlay_hint". Also, "vim.lsp.inlay_hint" does not exist. (However, a _field_ "_inlay_hint", note the underscore, does exist.) UPDATE: I works with commit c88bb65 that came as the nightly via Bob just few hours earlier. Strange...
Hmm odd, I've been using it for weeks. Not sure what was going on there. The following PRs added the functionality github.com/neovim/neovim/pull/23984 and github.com/neovim/neovim/pull/24074 Glad it's working for you now
wish there is a video and walk throught kickstart.nvim and add more feature to turn it into ide : )))
( i always have problem with adding folding in nvim distro that dont have folding as default )
I do have an old high-level walkthrough of kickstart.nvim, but it was before they switched to lazy.nvim. I've been toying around with a series of videos that shows features from a very basic level... like not using LazyVim or NvChad or things like that. I like kickstart.nvim because it's still pretty low-level and simple and a good place to build upon