New Native Neovim LSP Inlay Hints (Nightly Build)

Поділитися
Вставка
  • Опубліковано 4 лют 2025

КОМЕНТАРІ • 103

  • @cmdeckermusic
    @cmdeckermusic 5 місяців тому +1

    perf, that little snippet at 3:49 is just what i needed!

  • @starmechlx
    @starmechlx Рік тому +11

    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

  • @ascourter
    @ascourter Рік тому +10

    Good to see ya Elijah! Great video, looking forward to giving this a test drive. Also interested in a video on BOB!

    • @ElijahManor
      @ElijahManor  Рік тому +3

      Thanks man, appreciate you! And thanks for sharing your interest :)

  • @phaberest_
    @phaberest_ Рік тому +9

    This is definitely going to be one of my favorite nvim as an IDE features!

  • @elithrade
    @elithrade 10 місяців тому

    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.

  • @shivbhonde2389
    @shivbhonde2389 Рік тому +2

    Thanks so much !! Really loved that you even showed it for TS along with LazyVim config !

  • @ninjarogue
    @ninjarogue Рік тому

    Diggin the content! Surprised I never encountered your channel before.

  • @pascalallau1912
    @pascalallau1912 Рік тому +1

    Thank's, excellent video as usual and also interested in video on bob.👏

    • @ElijahManor
      @ElijahManor  Рік тому

      Thanks! Been working on an outline for bob :)

  • @jizhang2407
    @jizhang2407 Рік тому +1

    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.

    • @ElijahManor
      @ElijahManor  Рік тому

      Yay, glad it helped! Thanks for sharing

  • @noomondai
    @noomondai Рік тому +1

    Thanks for the great vid Elijah!

  • @felipegutierrez2944
    @felipegutierrez2944 Рік тому +1

    Great content, I hope to see you more often!

  • @worldxm
    @worldxm Рік тому

    A very useful keymap. Thank you!

  • @Redyf
    @Redyf Рік тому +1

    Your videos helped me a lot, especially the ones about lazyvim

    • @ElijahManor
      @ElijahManor  Рік тому +1

      So glad, thank you for supporting the channel! Glad to get out another video. Hope you have a great rest of the week!

    • @Redyf
      @Redyf Рік тому +1

      Thanks Elijah, have a great one too! 😄@@ElijahManor

  • @aquepaique
    @aquepaique Рік тому

    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
    ```

    • @ElijahManor
      @ElijahManor  Рік тому +1

      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!

  • @stoicfloor
    @stoicfloor Рік тому +1

    can't wait for it to make it to stable!

    • @ElijahManor
      @ElijahManor  Рік тому

      Yes, not sure when v0.10 is planned for, but hopefully soon :)

  • @hechuan5075
    @hechuan5075 7 місяців тому +2

    wondering where you have gone, looking forwqrd to thr next video man

  • @jizhang2407
    @jizhang2407 Рік тому +3

    Thanks for sharing. Yes, I'd like to learn how to use bob neovim version manager.

    • @ElijahManor
      @ElijahManor  Рік тому

      Awesome, good to know. It has been really helpful for me to try out new things, but switch to other versions as needed

  • @farzadmf
    @farzadmf Рік тому +1

    Great one, thank you!

  • @sebascm7278
    @sebascm7278 Рік тому +1

    Awesome. Thank you!!!

    • @ElijahManor
      @ElijahManor  Рік тому

      You are so welcome! Thanks for watching!

  • @ForeverZer0
    @ForeverZer0 Рік тому +5

    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).

    • @ElijahManor
      @ElijahManor  Рік тому +1

      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.

    • @AhmadMughal1
      @AhmadMughal1 Рік тому

      Any info on this yet ?

  • @bassamsaleh8034
    @bassamsaleh8034 Рік тому +1

    this is nice feature. thanks for the video. also interested in BOB the version manager :)

    • @ElijahManor
      @ElijahManor  Рік тому

      Glad you liked it and thanks for the interest! I'll need to plan an outline for that video. Seems to be of interest

  • @TheStickofWar
    @TheStickofWar Рік тому

    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 :)

  • @n0kodoko143
    @n0kodoko143 Рік тому

    Sweet 🎂!!

  • @masko0921
    @masko0921 Рік тому +1

    This feature will be very helpfull

  • @chaitany.a
    @chaitany.a Рік тому +1

    This have been in neovim for a couple of months now, and Intellij just announced this feature XD XD

    • @ElijahManor
      @ElijahManor  Рік тому

      It's been rolling out to numerous editors recently. Can be very handy

  • @JohnCostanzo
    @JohnCostanzo Рік тому +1

    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

    • @ElijahManor
      @ElijahManor  Рік тому +1

      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 UA-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.

  • @darkarie
    @darkarie Рік тому +14

    It would be really helpful if you add a git gist with all the code of the config.

    • @ElijahManor
      @ElijahManor  Рік тому +4

      Doh, was in such a hurry to get it out I missed that. Thank you for bringing it up!

    • @ElijahManor
      @ElijahManor  Рік тому +12

      Here you go :) gist.github.com/elijahmanor/8a51534e108c96db740a2e93f9310cce

    • @darkarie
      @darkarie Рік тому +3

      @@ElijahManor Thanks! That was quick.

  • @crowvampire
    @crowvampire Рік тому +1

    this video is great, I wondering what tool do you use to show your terminal in that way

    • @ElijahManor
      @ElijahManor  Рік тому +1

      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

  • @AbrahamAlcaina
    @AbrahamAlcaina Рік тому

    Configured, thank you really usefull

  • @neizvestniydrug
    @neizvestniydrug 9 місяців тому +1

    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

  • @adam29334
    @adam29334 Рік тому +1

    Hello, what are your thoughts on the new "/pmizio/typescript-tools.nvim" plugin? A faster alternative to the classic tssserver?

    • @ElijahManor
      @ElijahManor  Рік тому

      I should look into it, but haven't really played with it. Have you used it?

  • @achimdomma2171
    @achimdomma2171 Рік тому +1

    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?

    • @ElijahManor
      @ElijahManor  Рік тому +2

      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

  • @chyldstudios
    @chyldstudios Рік тому +3

    nice!

    • @ElijahManor
      @ElijahManor  Рік тому

      Thank you! Hope you find it helpful

  • @vikingthedude
    @vikingthedude Рік тому +1

    How do the inlay hints affect vim motions like w, e, b, etc?
    Will they be skipped as if they aren't there?

    • @ElijahManor
      @ElijahManor  Рік тому +1

      Good question. The inlay hints feature uses virtual text, so motions just are skipped over... it's like the hints aren't even there!

  • @neilkanakia
    @neilkanakia Рік тому +1

    I'd love to see a video about the nvim version manager, also what's the best way to be on the latest version

    • @ElijahManor
      @ElijahManor  Рік тому

      Awesome, started on an outline last night

  • @VinitKhandagle
    @VinitKhandagle 8 місяців тому

    this is cool, btw what colorscheme is that

  • @rezapanahi553
    @rezapanahi553 4 місяці тому

    What is the theme you are using in this video?

  • @equu497
    @equu497 Рік тому

    Show us the Bob
    (Thank you for all you do for this community)

    • @ElijahManor
      @ElijahManor  Рік тому

      Thanks for the support! Working on an outline now :)

  • @mainendra
    @mainendra Рік тому +1

    BOB 🙌

    • @ElijahManor
      @ElijahManor  Рік тому +1

      I'll start planning an outline. Thanks for the interest!

  • @VovaY
    @VovaY Рік тому +1

    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?

    • @ElijahManor
      @ElijahManor  Рік тому

      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.

  • @p1mml
    @p1mml Рік тому

    Nice, thanks! How do I setup the shortcut in LazyVim?

    • @ElijahManor
      @ElijahManor  Рік тому +1

      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

  • @priyamverma1975
    @priyamverma1975 Рік тому

    Hey there! Love your videos....is there any way you could share your kitty config??? :)

  • @SGTHome
    @SGTHome Рік тому +1

    Which font you use, bro?

    • @SGTHome
      @SGTHome Рік тому

      its jetbrains mono. but i also recomended use monaspace neon.

  • @brittager
    @brittager Рік тому

    Yes, I want the Bob Neovim config manager video. Pleeeeeeease! 🙂

  • @michaelchen8949
    @michaelchen8949 Рік тому

    how will this perform with copilot?

  • @coach587
    @coach587 Рік тому

    I don't have inlay_hint despite using sa,e version

  •  Рік тому +1

    Couldn't test it, apparently is messing the config of other plugins, but it is a cool feature

    • @ElijahManor
      @ElijahManor  Рік тому

      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

  • @Redyf
    @Redyf Рік тому

    Can you make a new video about lazyvim 0.10?

    • @ElijahManor
      @ElijahManor  Рік тому +1

      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 :)

  • @RootsterAnon
    @RootsterAnon Рік тому +1

    I see... I use AstroNvim so Shift+k is what serves me the most, but I see this as great addition to that.

    • @ElijahManor
      @ElijahManor  Рік тому +1

      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

  • @devabdul
    @devabdul Рік тому +1

    Anybody can help me to configure it for lunarVim

    • @ElijahManor
      @ElijahManor  Рік тому

      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

  • @DartMitai
    @DartMitai 8 місяців тому

    not working flutter/dart

  • @wh7988
    @wh7988 9 місяців тому

    that inlay hint looks disgusting, how can we do it rust style where it just lives on the right side without cluttering the screen

  • @matteostara
    @matteostara Рік тому

    Loving your stock nvim! Moved in from LazyVim or just fun?
    P.S. can you share the kickstarter we see on the video 🙏😁

    • @ElijahManor
      @ElijahManor  Рік тому +1

      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

  • @CarstenFuehrmann
    @CarstenFuehrmann Рік тому +1

    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...

    • @ElijahManor
      @ElijahManor  Рік тому +1

      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

  • @sinaebr7337
    @sinaebr7337 Рік тому +1

    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 )

    • @ElijahManor
      @ElijahManor  Рік тому +1

      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

  • @垚土土
    @垚土土 Рік тому +1

    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)