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.
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
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.
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!
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 :)
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
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
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.
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
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
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 :)
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.
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
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
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
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)
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
perf, that little snippet at 3:49 is just what i needed!
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
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 :)
wondering where you have gone, looking forwqrd to thr next video man
This is definitely going to be one of my favorite nvim as an IDE features!
Awesome, great to hear!
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
Thanks so much !! Really loved that you even showed it for TS along with LazyVim config !
Glad it was helpful!
Great content, I hope to see you more often!
Thanks, I hope you do too! 😀
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.
Diggin the content! Surprised I never encountered your channel before.
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
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
A very useful keymap. Thank you!
Glad it was helpful!
can't wait for it to make it to stable!
Yes, not sure when v0.10 is planned for, but hopefully soon :)
Thanks for the great vid Elijah!
Thanks, glad you enjoyed it!
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
Thank's, excellent video as usual and also interested in video on bob.👏
Thanks! Been working on an outline for bob :)
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 ?
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.
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!
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 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
This feature will be very helpfull
Yes, it has been fun to use!
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
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
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 :)
Which font you use, bro?
its jetbrains mono. but i also recomended use monaspace neon.
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
Great one, thank you!
Glad you liked it!
nice!
Thank you! Hope you find it helpful
Awesome. Thank you!!!
You are so welcome! Thanks for watching!
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
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?
BOB 🙌
I'll start planning an outline. Thanks for the interest!
I don't have inlay_hint despite using sa,e version
this is cool, btw what colorscheme is that
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!
Hey there! Love your videos....is there any way you could share your kitty config??? :)
Configured, thank you really usefull
YAY!
What is the theme you are using in this video?
Show us the Bob
(Thank you for all you do for this community)
Thanks for the support! Working on an outline now :)
how will this perform with copilot?
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.
Sweet 🎂!!
Thank you 😋
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
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
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 :)
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.
Yes, I want the Bob Neovim config manager video. Pleeeeeeease! 🙂
not working flutter/dart
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
that inlay hint looks disgusting, how can we do it rust style where it just lives on the right side without cluttering the screen
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
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
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)
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