Basic Neovim LSP Setup (with Treesitter and Completion)

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

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

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

    Wow! I spent an embarrassing amount of time trying to configure lsp's. Great , simple yet highly effective tutorial. Thank you!

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

    This missed the fact that there's a better than keyword completion built in in to vim / vim-lsp.
    That is the omnifunc completion.
    set omnifunc=v:lua.vim.lsp.omnifunc
    The completion triggers with in insert mode, when buffer has a language server with completion support attached.

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

    Thanks a lot for the great much needed vedios. just a tip, in the packer setup, we can pass use to the function itself as it says in the documentation and get rid of the warning

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

    this is a TH-cam gem. Liked, subbed, and I’m staying tuned for the C++ tutorial.

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

    Man your channel is gold! Super eager for the c++ config vid you put out next using lsp! :D

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

    Excellent tutorial, really well structured! Best tutorial I've seen yet on configuring LSP and Treesitter for Neovim.

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

    Thank you for the amazing video! I have been wanting to move to LSP + Treesitter for a while now, but have not been able to efficiently get it to work without spending hours on it, so I always revert to my old ways. Thank you!!

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

    Simple walkthrough. Good Job!

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

    Great video! Looking forward to your C++ video!

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

    Excellent video! I did not know about lsp-installer. Thank you and looking forward to future videos!

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

    When I try to include “ensure_installed = maintained” in the treesitter config I get an error saying that “parser not available for language maintained”. I don’t know if they changed something but it doesn’t seem like that is an option anymore

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

    Works like a charm) Thank you!

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

    These are so helpful! Subscribed and looking forward to whatever you choose to make next.

  • @maximilianlosch7479
    @maximilianlosch7479 2 ปีที่แล้ว

    Vim and Neovim both handle and as not equivalent. does not trigger all the events that does, since the wierdness when leaving insert mode.

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

    for some reason whenever I use nvim cmp and try to open a new buffer it spawns a random number of empty buffers, which are also inaccesible

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

    Fantastic video, really explained these concepts in a clear and concise manner. Would be good to provide links in the video description to your repo.

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

    Amazing work! Looking forward to the webdev video for this!

  • @nilventosa
    @nilventosa 2 ปีที่แล้ว

    The option of maintained is not working anymore in treesitter. The languages have to be specified now like: ensure_installed = {'python', 'cpp'}

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

    How about a video about some productivity tools (If you use them)? nvim-orgmode etc.

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

      Check out my videos on vimwiki and task warrior integration. Those were some of my first videos and I was just testing out this TH-cam thing but if there’s interest I can do another productivity video that’s more streamlined.

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

    Amazing!

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

    is it just me or some colorschemes arent fully ported to tree sitter ? I've found the syntax hilighting to be kind of hit or miss. even though I have the exact same config as the docs

    • @kandodev
      @kandodev  3 ปีที่แล้ว

      Most color schemes just work but there are some that have issues. Some of the newer ones explicitly call out treesitter support as well.

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

    Pretty good video although you configure Lua autocompletion manually while using lsp installer that iterates over servers. I think it would make more sense to include autocompletion setup in lsp installer init loop

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

    Great video really helpful.

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

    Fantastic video! I have been trying to get a good c# enviro setup. Maybe starting from scratch with your vids may help. Thanks for putting these together.

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

    Nice video, do you still plan to make a video on C++? If so, do you get added values over coc config?

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

    Hey there! What's the font you use in your editor?

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

      It's Dejavu Sans Mono

    • @MercUndGut
      @MercUndGut 3 ปีที่แล้ว

      @@kandodev Thank you!

  • @Vijay-fd7ui
    @Vijay-fd7ui 3 ปีที่แล้ว +4

    First of all thanks a lot for these series of videos, was very helpful! The setup was seamless for me untill this point of setting up the completions using nvim-cmp, I get this error :
    "Spawning language server with cmd: `lua-language-server` failed. The language server is either not installed, missing from PATH, or not executable." The lsp is definitely installed(Cause I get diagnostics) .Also completions still seem to work despite the error.
    The nvim-lsp-installer page[setup section] talks about how the servers are not installed in the path and for the lsp client to detect the server, you have to mention a cmd property in the setup part along with the path to the server. I also tried adding the lua-server directly to the path and both methods were able to fix the above error, but then the 'global vim is undefined' pops up only at this place "vim.lsp.protocol".
    Did I mess up somewhere? How did you get it work without having to do anything else? Really appreciate the help!

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

      It's possible that the lua language server did not install properly. By default this should install in ~/.local/share/nvim/lsp_servers/sumneko_lua/extension/server/bin/lua-language-server. When you run :LspInfo on a lua file, it should tell you where it's searching for the lua language server. Then you can check it exists there.

    • @sendmeabouquet
      @sendmeabouquet 2 ปีที่แล้ว

      same here

    • @matiasmazzanti3345
      @matiasmazzanti3345 2 ปีที่แล้ว

      @@kandodev Same situation here

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

    Thanks for sharing!

  • @ИванКонкин-с4м
    @ИванКонкин-с4м 2 ปีที่แล้ว

    what is your DE?

  • @gz6616
    @gz6616 2 ปีที่แล้ว

    Is it true that nvim-cmp doesn't offer completions from OTHER buffers?

    • @gz6616
      @gz6616 2 ปีที่แล้ว

      answer myself: Not true!

  • @Sebatorsk
    @Sebatorsk 3 ปีที่แล้ว

    Can I find you dotfiles somewhere? I'm curious if you've setup nvim lsp with clangd

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

      I have it working right now. Working on a followup video about that (using ccls) and I'll attach a github.io link where you can see how I configured it. I don't actually keep a single set of dots. The channel means I'm always testing things out and making changes all over the place and it's often broken until I can fix things so I tend not to share a single dotfiles repo but snippets per video.

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

      @@kandodev Thanks for the response. It's working well enough for me too right now but I'm always curious to see other people's C++ configurations. Looking forward to the video!

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

    For me, nvim-compe was way faster and easy to use than nvim-cmp. I don't know why they deprecated the project ☹️

    • @kandodev
      @kandodev  3 ปีที่แล้ว

      Yeah I thought it was a lot nicer too 😞

  • @cilantrin4403
    @cilantrin4403 2 ปีที่แล้ว

    this is fireship, right?

    • @kandodev
      @kandodev  2 ปีที่แล้ว

      hah I wish.

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

    With nvim-cmp all of a sudden my command line completions stopped working until I removed the part of the config that starts with cmd.line.setup.
    He warns about this in the config and pointed this out to someone with the same issue I had.
    Nice video!

    • @kandodev
      @kandodev  3 ปีที่แล้ว

      Thanks for mentioning that!

  • @bryanboateng
    @bryanboateng 2 ปีที่แล้ว

    I love you