Neovim - Why I'm switching to Native LSP over CoC

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys in this video i just wanted to give a quick explanation as to why i'm moving away from a conqueror of completion for neovim in favor of um the built-in lsp that will be in neovim in the future and basically i'll just be going over some of the reasons as to why i'm moving over and kind of uh the road map for where neovim's going soon so you might know that neovim 0.5 is coming out soon current currently we're on like neovim 0.4 or something um and 0.5 is really going to have a lot of big updates with it uh so for instance you'll be able to do like an init.lua with this instead of init.vim and i think that's already supported there you'll see that this is still in a vim file but in the future pretty much everything will be configured with lua you can see like already a lot of my config is like moving over to lua anyway so you can expect like most plug-ins or mostly everything in neovim to just kind of um be going in that direction now that doesn't mean that all of them script is going to be completely obsolete it'll probably and will always be supported uh in the text editor but you will notice that a lot of people uh will be switching for uh like lua and all that kind of stuff just for all the cool things that lua provides us it's almost like having like how emacs has like e-lisp right um the other thing is you know lsp is built in now and that's kind of like the reason that i'm saying that i would be moving away from coc right so if you do h and then you do lsp here you'll see like okay there's a ton of documentation for lsp that's actually just built into new of them now so like why would i not use what's built in and i'm assuming there's going to be a lot of community support for what's already built in here now they provide a pretty um general api so like they're not it's not opinionated at all so there's still going to be like a lot of plug-ins that are going to be like essentially implementing this and coming up with cool ways to use it and kind of present it but that's kind of the underlying um that's what i want to use is what's built in right like i want to use what's underlying and built into neovim itself um now i'm going to go over a couple things here so like the milestone thing the reason i'm switching over now is like this is happening soon like 0.5 is probably going to be out i mean if if you believe this in four days now i don't necessarily believe this um they say christmas is coming um i mean we'll see right uh it might come out on the 14th but it probably will come out soon so like there's only a few issues that are really left here i guess until they can say that it's done um and for me i've been using it for a while and it seems to work just fine for me um the other thing i wanted to go over was um yeah you could just like this plug-in for instance called lsp or nvm lsp config and i'm going to be doing a video i'll release it tomorrow about this um and and a couple other uh and another plug-in and just the other ways that you can kind of set up the uh the native lsp but essentially you can see like all of these language servers are you know supported here right and like they're all using built-in lsp and or well the built-in like language server protocol they don't need coc anymore right a lot of people or a lot of time well for most of the people that were using cfc they were using it mostly just for this reason now coc does extra stuff and a lot of other things but i just feel like i don't know it's just it's probably simpler um just to move maybe not simpler but in the long run it'll be simpler probably just to move over to something like this um so you could check out this but like i said i'll do a video tomorrow kind of explaining some of these um another issue that i wanted to go over was in the coc repo like you can see like this guy was asking some questions like is coc an alternative to lsp support does native lsp support benefit to coc in some ways and does native lsp support shadow coc in some ways so is coc an alternative to lsp it is an alternative uh does it support coc no and does it shadow so you say no so so like it's it's just an alternative and i'd rather just go with what's built in like i said you know um coc is still great and it works really well but it's if it's not going to like use what's already there then i just i i don't i don't know i just i kind of see it being pushed out in the future you know um although it is you know pretty good software and i used it for a while so i don't really have anything really bad to say about it um so yeah so basically i have a lot of this stuff in the config now um i updated it uh i just kind of i spent like a day just moving like um some things over to lua checking out some new plugins that support the uh the native um the native language server protocol so you can check that out over here and you can kind of see where i'm going my plan is to hopefully move like right now you see like 80 vim script here and like 15 lua the plan is to hopefully like get this to around the opposite right like 80 lua and like um like 15 vim script if possible and that's not like the only thing that's coming out with uh neovim so you'll see things like tree sitter coming out um is coming out and it's going to be supported so if you don't know what tree sitter is i think i did a video on it before and i'll probably do a better video on it in the future but if you see like all of this good uh syntax highlighting here like that's all provided by tree sitter and tree sitter does like way more than just the syntax highlighting and we'll probably continue to do a whole lot in the future um but you can see like you know like this just looks so much better than any other color scheme i've ever seen uh you know in neovim before and you can just see how fast like the new things like here's like a tool tip that comes with uh one of the new things like you see that little light bulb there um let's see like if i get rid of this i'm trying to look for some lsp here like some diagnostics like see the diagnostics are here and it's still a little rudimentary like um you know this little box and i don't know if you have the i don't know if it's super easy to like turn on and off the virtual uh text and all that like i haven't really tried that hard like i haven't really played with it too much but it is here and it does work so you know why not support it just out of the box you can see like it's really fast too like if we go to like go to different go to definition for header there like that's really fast moving back whatever you can like uh go to references so like you do gr on this it's really fast this is used all over the place you know in the project here so yeah and i just expect like in the future you'll probably see cool things like floating windows and all that kind of stuff supported like um i know uh lsp saga is another one i think i have something working with lsp saga uh i don't know exactly what it is but you can do like i don't know i'm trying to remember exactly i guess it has format no this is some of the stuff that i have so if you do lsp saga and then like this stuff yeah like it has like built-in rename and hovering over the dock and it uses like these cool um uh floating terminals and stuff like that so you can already see like that's just one plug-in that's starting to use it and i i think a lot in the future are gonna be are gonna be doing that another really cool one i use java a lot too if we come over here what i'm going to do is i'm just going to go check out the wiki you can go on the wiki for the nvim lsp config and let's see further integration examples language specific plugins yeah so if you go to envim jd tls this is what i'm probably going to be setting up in the future because i write a lot of java um basically like this whole plugin here is meant as kind of a layer on top of this config right so that you can so that you can essentially like get all that java support like almost it's still going to be difficult to set up because it's java right but it has really cool things like um one that i really like and i'm looking for it here is this stuff that's coming out with mvim dap or invindapp um i i think it's like debugger adapter protocol or something like that i don't really know what dap stands for but i know that it'll be cool because what i'll be able to do is you can do test class and test nearest method probably is like code actions now i haven't set this up yet but you'll be able to do things like code actions and that was kind of one of the reasons that i was still playing around with vs code was because like when i'm going through tests and i have a big giant test file with like 50 tests in it and i just want to run one at a time uh you know this is this is kind of what i wanted and i just couldn't find that really anywhere else and this seems to be available now so um this is something i plan on setting up in the future at least for java uh yeah so that's pretty much i guess like the interesting bits of the road map that are coming um i'm sure there's a lot more stuff that's going to be coming out with like 0.51 and 0.5 so on and so forth but like this is kind of a pretty big milestone or a pit yeah pretty big milestone in uh neovim's development here so i just wanted to explain that if anyone was looking at like my config and noticed like all the coc stuff's gone or everything changed and like how do you set up uh the new lsp stuff uh there will be a video coming out tomorrow that kind of explains how to install that stuff and how to get it all set up um it'll probably be somewhat difficult to do in the future like for now but in the future there's going to also be things like um let's see here let's go back there is gonna be let's see installing language servers automatically like you already see there's a couple plugins here and in the future like for instance it used to like neovim when they were doing this they used to have like an lsp install functionality but i guess they got rid of it um there's probably going to be plug-ins that just make it a lot easier i guess this one here supports like bash cmake so and so forth like all these guys here obviously it's probably not going to support jdtls and java because again that can be a nightmare and some of the more difficult ones um but you know they have a roadmap to do this and wouldn't it be nice if like this plug-in right here just like you could just do like uh lsp install and pick like a thing you know and then just have it like almost like how vs code is and not even think about it you know besides maybe like some configuration somewhere um so i hope you know this project kind of continues with what they're doing because that would be that would be really cool but yeah anyway um that's pretty much this video make sure to like and subscribe and i'll see you guys in the next one
Info
Channel: chris@machine
Views: 58,328
Rating: undefined out of 5
Keywords: chrisatmachine, native lsp, neovim, neovim 0.5, vim, coc, conquer of completion, ide, treesitter, vscode
Id: 190HoB0pVro
Channel Id: undefined
Length: 11min 23sec (683 seconds)
Published: Wed Mar 10 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.