Neovim - LSP Setup Tutorial (Built in LSP 100% Lua)

Neovim - LSP Setup Tutorial (Built in LSP 100% Lua)

chris@machine

2 года назад

147,261 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@josefhula9811
@josefhula9811 - 19.11.2023 17:47

Thanks a lot, great comprehensive and explanatory video

Ответить
@FoolsTech
@FoolsTech - 19.10.2023 01:50

The author of Lua is using M as abbreviation for Module all across his book Programming in Lua, especially in the chapter "The Basic Approach for Writing Modules in Lua". Though I don't recommend this book for getting started with Lua for Neovim, since it's covering Lua 5.3 which has some significant changes since 5.1 which is used in NeoVim's LuaJit. And it's also very academical and has a horrible editing and didactic approach, despite 4th edition. You're better off with Neovim's lua help pages. But once you figured out most important stuff in NeoVim and Lua it might be a valuable resource for advanced Lua programming.

Ответить
@qballer_
@qballer_ - 17.09.2023 23:27

M is for Module

Ответить
@NilsEckelt
@NilsEckelt - 07.08.2023 22:31

:LspInstallInfo didn't work for me. Now I'm eager to find out why 😃

Ответить
@mlshenhua1
@mlshenhua1 - 10.07.2023 17:29

cmp-nvim-lua should be replaced by plugin neodev.
lsp-installer should be replaced by plugin mason

Ответить
@r0yce
@r0yce - 20.05.2023 16:18

This is probably the most important video. And since it has gone somewhat obsolete it would be great if you made another video on this. I know your repo has the latest code but your explanations are really helpful.

Ответить
@crytex1747
@crytex1747 - 07.05.2023 03:16

This whole series is so awesome!

Ответить
@adamkarafyllidis9264
@adamkarafyllidis9264 - 18.04.2023 04:53

Nice tutorial for us newbies! Is there any chance that you worked with a NX integrated monorepo?! I cannot get the "find references" feature to work and this is holding me back from using neovim! Thanks!

Ответить
@ruchejok4946
@ruchejok4946 - 14.04.2023 18:58

Dude, you're godsent. Thank you, thank you, thank you for your amazing playlist, and for all the hard work you've put into creating your repo and teaching a bunch of randos online how to turn neovim into an amazing, personolized IDE. I've been doing a lot of work in Inteliji Idea, and though it is very good in its niche, I grew tired of all the bloat, lags, and endless indexing. This, what you've done to promote neovim to people, is truly great. 10/10

Ответить
@amircodes
@amircodes - 17.03.2023 19:32

Hi I hope you see this CM. Which font are you using in this video? and which theme? Thanks

Ответить
@iuiz
@iuiz - 22.02.2023 15:50

This content in the Repo is not the content from this video. For example the installer File is missing.

Ответить
@kenng3271
@kenng3271 - 17.02.2023 02:39

Very good tutorial, thanks for creating it

Ответить
@masomahboob
@masomahboob - 27.01.2023 19:52

the `gl` command doesn't expand the error message for Rust. I have rust-analyzer installed, still doesn't work. What to do?

Ответить
@zheli2417
@zheli2417 - 31.12.2022 18:56

Hi chris, love your videos and like your wallpaper more : ) . Can you share your wallpapers to us?

Ответить
@56phil020244
@56phil020244 - 31.12.2022 16:41

Excellent series, Chris. I have a LSP question. Thanks to lsp-zero and Mason, I'm set up for C++. There's one minor issue, it's flagging a correct statement as an error. I think that's because I'm using c++20, and clangd is using an earlier standard. How do I get clangd to use C++20? Thank you.

Ответить
@eugenechew9336
@eugenechew9336 - 26.12.2022 23:54

Can you make a video updating the LSP Config using mason.nvim instead? nvim-lsp-installer is no longer being maintained. Thanks!

Ответить
@Jana-om3kp
@Jana-om3kp - 24.12.2022 07:41

Even a year after, this playlist is helping me learn how to configure neovim so good.

Ответить
@beepst
@beepst - 11.12.2022 09:37

If anyone else is having issues with null-ls being shown as the client for TS, add "tsserver" to the servers table in user/lsp/mason.lua.

Ответить
@reubenpopp2006
@reubenpopp2006 - 05.12.2022 23:39

So, one thing I noticed while getting this working is that I have to be typing a method name to get the signature/docs to show. Is there a way to hover on a method (eg, go's fmt.Printf) and have it display the text without having to do a substitution on Printf?

Ответить
@itsrobel
@itsrobel - 29.11.2022 02:43

Thank you very much for this useful resource.
How are people getting the icons to display properly? They're not displaying well when I checkout the repo.

Ответить
@cthutu
@cthutu - 23.11.2022 14:02

You don't need cmp_nvim_lua now since the LSP manages it with the Lua server.

Ответить
@cthutu
@cthutu - 23.11.2022 12:37

I imagine 'M' stands for Module.

Ответить
@hanspetervollhorst1
@hanspetervollhorst1 - 18.11.2022 23:03

It appears you have replaced nvim-lsp-installer by something named mason?

Ответить
@9bnmadden
@9bnmadden - 15.11.2022 16:46

10xing my understanding of NVIM with this series! This is so awesome. Your hard work on all this is appreciated.

Ответить
@sebastianmangelsen8056
@sebastianmangelsen8056 - 11.11.2022 00:13

Tack!

Ответить
@locbac
@locbac - 01.11.2022 02:01

I get this error:
Error while calling lua chunk: C:\Users\a\AppData\Local\nvim/lua/user/lsp/mason.lus:36: attempt to index a boolean value stack traceback:
C:\Users\a\Appdata\Local\nvim/lua/user/lsp/mason.lua:36: in main chunk
[C]: in function 'require'
C:\Users\a\Appdata\Local\nvim/lua/user/lsp/init.lua:6: in main chunk
[C]: in function 'require'
C:\Users\a\Appdata\Local\nvim\init.lua:6: in main chunk

Ответить
@Aucacoyan
@Aucacoyan - 27.10.2022 19:36

Hi! Awesome video, as always, I'm binging all the content. Can you please update this video for mason? because the repo it's now updated on the branch LSP. Thanks!

Ответить
@JustProGame
@JustProGame - 25.10.2022 01:12

why there is different files in the repo in lsp branch? i just wanted to copy some of the code, because your vids was helpfull so far, and its just no there. can you pls mark this video outdated and link new one in the description

Ответить
@rohitsrao
@rohitsrao - 19.10.2022 16:37

As of 19 Oct 2021, it is recommended to use cmp_nvim_lsp.default_capabilities(capabilities) instead of cmp_nvim_lsp.update_capabilities(capabilities) as the latter will be deprecated

Ответить
@neizvestniydrug
@neizvestniydrug - 14.10.2022 22:07

nah, this is too much for a code editor! i don't want to spend half my life reading docs, writing configs, programming my code editor instead of doing my work. i guess i'll stay with vscode. i tried to follow (but now nvim-lsp-installer is called mason.nvim) and make pyright work, but it's just not working at all.

Ответить
@nupea3744
@nupea3744 - 13.10.2022 09:04

Hi, Thanks for the great tutorial, but I want ask something about "lsp_highlight_document" (the M.on_attach set up function).
I mention that is not work on my neovim, so I think the problem is "client.server_capabilities.documentHighlight", and then I print the value, I get "nil", and then I print the other value (client) I get "{".
so... I just want ask how can I print the right value from config file? no matter I use "print" or "vim.vim.pretty_print" I always get a single curly bracket ( "{" ), that's make me really confusing. I didn't know is I use the wrong way or something wrong,

Ответить
@duyhung.30
@duyhung.30 - 09.10.2022 19:42

can u make another vid using mason.nvim plss

Ответить
@himanshutripathi7441
@himanshutripathi7441 - 07.10.2022 07:49

Thank you for these videos.
Best LSP tutorial

Ответить
@jamesstakebake3481
@jamesstakebake3481 - 05.10.2022 19:43

I'll bet you M stands for module a generic name for a set of code. I know this is just speculation but it makes sense to me

Ответить
@hechuan5075
@hechuan5075 - 03.10.2022 01:22

Thank you very much Chris for all these tutorials, i am learning a ton from you.

Ответить
@shiny_apricot
@shiny_apricot - 30.09.2022 16:58

The LSP is not working I tried everything for DAYS, I am about to lose my mind. Pyright and copilot is not working in python files here is my config of pyright.lua in configs file: ( i added that into servers list and installed pyright)

return {
settings = {
python = {
analysis = {
indexing = true,
typeCheckingMode = 'basic',
autoSearchPaths = true,
diagnosticMode = "workspace",
useLibraryCodeForTypes = true
},
},
},
filetypes={
"python"
},
cmd={
{ "pyright-langserver", "--stdio" }
},
}


===============================
Here is configs.lua

local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer")
if not status_ok then
return
end

local lspconfig = require("lspconfig")

local servers = { "jsonls", "sumneko_lua", "pyright", "copilot" }

lsp_installer.setup({
ensure_installed = servers,
})

for _, server in pairs(servers) do
print("SERVEr=",server)
local opts = {
on_attach = require("user.lsp.handlers").on_attach,
capabilities = require("user.lsp.handlers").capabilities,
}
local has_custom_opts, server_custom_opts = pcall(require, "user.lsp.settings." .. server)
if has_custom_opts then
opts = vim.tbl_deep_extend("force", opts, server_custom_opts)
end
lspconfig[server].setup(opts)
end

Ответить
@MrBlack-cv8qn
@MrBlack-cv8qn - 26.09.2022 13:49

Hey, could you help me with this problem: when i open a python script the language is detected but pyright is not attached when i look LspInfo, thanks!

Ответить
@amanzholzhalynuly1881
@amanzholzhalynuly1881 - 25.09.2022 22:10

thanks man

Ответить
@danhenri3310
@danhenri3310 - 22.09.2022 14:59

anyone getting an "attempt to index a boolean value" about their lsp/init.lua file for the "require("user.lsp.handlers).setup()" line? Can't figure out what's wrong but I assume something with the setup function?

Ответить
@ebiscaia
@ebiscaia - 17.09.2022 06:45

Hi Chris,

Any chance of updating this tutorial as nvim-lsp-installer will not be maintained anymore? In my case my diagnostics are messed up (just first occurrence appears). It seems like it is ignoring some parts of the handler file.

Thanks

Ответить
@samueljensen7720
@samueljensen7720 - 11.09.2022 17:09

Really helpful content, subscribed and liked, one questions tho
I found that the Lua Lsp already provides what `cmp-nvim-lua` provides, is `cmp-nvim-lua` providing something more that I don't know of?

Ответить
@undertheradar4645
@undertheradar4645 - 05.09.2022 20:32

Man, this tutorial, playlist, channel.. is genuinely invaluable

Ответить
@nikob381
@nikob381 - 27.07.2022 05:16

Man thank you so much for these videos. Every other resource seems to go down the COC route so it's nice to finally see an alternative setup that happens to match much of what I'd already put together myself so far. This playlist is amazing.

Ответить
@bendirval3612
@bendirval3612 - 25.07.2022 22:04

This is a maddening amount of configuration. The old vimscript plugins just require a couple of variables to be set for each plugin, at most. I don't normally shy away from config work, but these lua plugins are just too much work--they don't seem ready for ordinary usage. The deeper I get into this project, the more unwieldy it gets.

Ответить