New Native Neovim LSP Inlay Hints (Nightly Build)

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ธ.ค. 2024

ความคิดเห็น • 103

  • @cmdeckermusic
    @cmdeckermusic 4 หลายเดือนก่อน +1

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

  • @starmechlx
    @starmechlx ปีที่แล้ว +10

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

  • @hechuan5075
    @hechuan5075 5 หลายเดือนก่อน +2

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

  • @phaberest_
    @phaberest_ ปีที่แล้ว +9

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

    • @ElijahManor
      @ElijahManor  ปีที่แล้ว +1

      Awesome, great to hear!

  • @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

  • @shivbhonde2389
    @shivbhonde2389 ปีที่แล้ว +2

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

  • @felipegutierrez2944
    @felipegutierrez2944 ปีที่แล้ว +1

    Great content, I hope to see you more often!

    • @ElijahManor
      @ElijahManor  ปีที่แล้ว

      Thanks, I hope you do too! 😀

  • @elithrade
    @elithrade 8 หลายเดือนก่อน

    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.

  • @ninjarogue
    @ninjarogue ปีที่แล้ว

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

  • @neizvestniydrug
    @neizvestniydrug 8 หลายเดือนก่อน +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

  • @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

  • @worldxm
    @worldxm ปีที่แล้ว

    A very useful keymap. Thank you!

    • @ElijahManor
      @ElijahManor  ปีที่แล้ว +1

      Glad it was helpful!

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

  • @noomondai
    @noomondai ปีที่แล้ว +1

    Thanks for the great vid Elijah!

    • @ElijahManor
      @ElijahManor  ปีที่แล้ว

      Thanks, glad you enjoyed it!

  • @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

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

  • @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 11 หลายเดือนก่อน

      Any info on this yet ?

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

  • @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!

  • @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

  • @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

  • @masko0921
    @masko0921 ปีที่แล้ว +1

    This feature will be very helpfull

    • @ElijahManor
      @ElijahManor  ปีที่แล้ว

      Yes, it has been fun to use!

  • @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

  • @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

  • @TheStickofWar
    @TheStickofWar 11 หลายเดือนก่อน

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

  • @SGTHome
    @SGTHome 10 หลายเดือนก่อน +1

    Which font you use, bro?

    • @SGTHome
      @SGTHome 10 หลายเดือนก่อน

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

  • @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

  • @farzadmf
    @farzadmf ปีที่แล้ว +1

    Great one, thank you!

  • @chyldstudios
    @chyldstudios ปีที่แล้ว +3

    nice!

    • @ElijahManor
      @ElijahManor  ปีที่แล้ว

      Thank you! Hope you find it helpful

  • @sebascm7278
    @sebascm7278 ปีที่แล้ว +1

    Awesome. Thank you!!!

    • @ElijahManor
      @ElijahManor  ปีที่แล้ว

      You are so welcome! Thanks for watching!

  • @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

  • @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?

  • @mainendra
    @mainendra ปีที่แล้ว +1

    BOB 🙌

    • @ElijahManor
      @ElijahManor  ปีที่แล้ว +1

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

  • @coach587
    @coach587 10 หลายเดือนก่อน

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

  • @VinitKhandagle
    @VinitKhandagle 7 หลายเดือนก่อน

    this is cool, btw what colorscheme is that

  • @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!

  • @priyamverma1975
    @priyamverma1975 ปีที่แล้ว

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

  • @AbrahamAlcaina
    @AbrahamAlcaina ปีที่แล้ว

    Configured, thank you really usefull

  • @rezapanahi553
    @rezapanahi553 3 หลายเดือนก่อน

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

  • @michaelchen8949
    @michaelchen8949 ปีที่แล้ว

    how will this perform with copilot?

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

  • @n0kodoko143
    @n0kodoko143 ปีที่แล้ว

    Sweet 🎂!!

  •  ปีที่แล้ว +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

  • @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

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

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

  • @brittager
    @brittager ปีที่แล้ว

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

  • @DartMitai
    @DartMitai 7 หลายเดือนก่อน

    not working flutter/dart

  • @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

  • @wh7988
    @wh7988 8 หลายเดือนก่อน

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

  • @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

  • @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

  • @垚土土
    @垚土土 11 หลายเดือนก่อน +1

    The API has undergone similar changes. The interface has been changed from “ vim.lsp.inlay_hint” to “vim.lsp.inlay_hint.enable“.

    • @垚土土
      @垚土土 11 หลายเดือนก่อน

      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)

  • @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