Neovim Config - Part 3 -- LSP

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ม.ค. 2025

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

  • @germandavid2520
    @germandavid2520 ปีที่แล้ว +14

    1:07:38 Prime is right, these snippet plugins have a lot of snippets that are not useful and only create noise, that's why I removed them from my configuration a few months ago, in my autocomplete I only have what LSP and nvim-async-path.
    Although you can still configure your own snippets, you just have to create a directory wherever you want and imitate the file structure of the rafamadriz/friendly-snippets repository, configure the package.json, the snippets are just a json file with some properties.

  • @Scooplar
    @Scooplar ปีที่แล้ว +8

    @primeagen will share your config on github once you have dailed in the last few things you wanted? - it would be much appreciated!

  • @BucketHead6541
    @BucketHead6541 6 หลายเดือนก่อน

    lsp-zero's changes and packer dying were the two best things that happened to my neovim journey after going through 0 to LSP. Learned so much through that process and my config is truly mine.

    • @Kian-z8m
      @Kian-z8m 6 หลายเดือนก่อน +1

      so true

  • @themohmand
    @themohmand 10 หลายเดือนก่อน +2

    My lua_ls won't show any hover documentation after migrating to Lazy, help please!

  • @simonsolnes5190
    @simonsolnes5190 ปีที่แล้ว +17

    You can just say `config = true` and it will do `function() require("x").setup { } end` automatically

    • @SiddharthPant
      @SiddharthPant ปีที่แล้ว +7

      Also happens when you provide `opts = {}`, lazy.nvim will automatically call `require("your-plugin").setup(opts)`

    • @tauiin
      @tauiin ปีที่แล้ว +4

      @@SiddharthPantyeah opts is great

  • @bwemery5
    @bwemery5 11 หลายเดือนก่อน +6

    will these updates be pushed to github?

  • @RyanGause
    @RyanGause ปีที่แล้ว +18

    where the dotfiles?

    • @manojbijalwan
      @manojbijalwan 10 หลายเดือนก่อน +5

      Create your own config

    • @MCroppered
      @MCroppered 8 หลายเดือนก่อน +3

      You have to grow the moustache to get the files for free

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

    it's funny watching this now and knowing that blue hair does indeed happen

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

    It's funny to look at Prime twitching without music, it reminds me of this joe rogan episode where they discussed hitler on meth on olymic games

  • @Wh4tsupy0
    @Wh4tsupy0 10 หลายเดือนก่อน +2

    I'm trying to make the switch to neovim after VSCode's C/C++ extension has literally been crashing the editor from using 15+ GB of memory, the setup videos have been super helpful, definitely stealing some remaps too.

  • @milindvaidya1599
    @milindvaidya1599 9 หลายเดือนก่อน +1

    Hey..I am big fan of vim and now neovim. Using it for personal programming and trying to use it on company laptops as well. Recently, I joined a company and they are discouraging using neovim and plugins. The concern of using something like GPT based plugin may be valid but in general the claim is plugins enable some random code executing in vim / neovim. I am not sure how plugin in mechanism works. But can you please throw some light as to security vulnerabilities of plugins if any.

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

    I've just watched 2:15 of setting up neovim; no 2:45 because I found the packer 1 first. And it's taken me longer than that because I was playing along. I'll come back tomorrow for lsp.

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

    I agree, too many people default to grabbing another plugin when it isn't necessary, which is why I have no plugins installed, and just write everything myself in Vimscript.

    • @peterszarvas94
      @peterszarvas94 8 หลายเดือนก่อน +1

      in vimscript? dude why not lua

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

    the diagnostic looks pretty slow, does it because it called after everything initialize?

  • @awesomedavid2012
    @awesomedavid2012 ปีที่แล้ว +4

    I tried not using lsp zero and maybe I'm just bad, but I found it so infuriating having my lsp break anytime I opened a new language. I couldn't configure html for the life of me.

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

      mason-lspconfig auto-attaches installed LSPs to supported buffers. `html` LSP works out of the box for me. I think kickstart.nvim default config will handle your needs.

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

      after I watch prime set up everything manually I suddenly understand why something like lsp_zero exists

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

      @@gittawat6986 true. But I had to figure out a way to go without it because it took 50ms to initialize lspzero for some reason and was a visible delay on startup. Now it's under 10ms.

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

      It’s genuinely not hard.
      1.) Install LSP on host system
      2.) Call lspconfig.lang.setup
      3.) And cmp.

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

      But in general is just so infuriating, the setup is so criss cross and complicated

  • @mrudulmohan9219
    @mrudulmohan9219 5 หลายเดือนก่อน

    can anyone help me with installing undotree in nvchad?

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

    are his current dotfiles on github?

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

    How do you debug?

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

    With copilot being so good I honestly feel like snippets are simply bloating my autocomplete.

    • @heroe1486
      @heroe1486 9 หลายเดือนก่อน

      Nonsense, a snippet is something that is 100% what you want, copilot is more often than not some bullshit you have to process before accepting, which takes you out of the flow. It's like saying you'd want to replace Lsp's autocomplete by copilot

  • @matiasmazzanti3345
    @matiasmazzanti3345 4 หลายเดือนก่อน

    Great!!! Still waiting for a 4th part!

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

    anyone know what is his iterm2 colorscheme???

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

      he is on linux so he is not using iterm2. for the colourscheme, I am pretty sure he is using some customised version of rosepine

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

    I am surprised that you didn't use none-ls for diagnostics, formatting and linting. it is null-ls reloaded

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

    thanks primeagen

  • @AlexKen-zv8mm
    @AlexKen-zv8mm 10 หลายเดือนก่อน

    Did he push this entire config on github ? Sauce peweee !!

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

    min 36: append a comma to the end of some lines C-v3j$A,^]

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

    LEEETS GO

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

    а че делать

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

      дивитись

    • @imaksimus
      @imaksimus ปีที่แล้ว +5

      І вчити державну

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

      @@imaksimus у нас все государственный знают

    • @andrii7879
      @andrii7879 ปีที่แล้ว +4

      вивчити нормальну мову

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

      @andrii7879 "нормальна мова" - это английский, остальное не нужно

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

    would've been better to do this off stream and come on a stream and re-do it with all the knowledge and configs ready. this was just way too spastic

    • @ditchcomfort
      @ditchcomfort ปีที่แล้ว +5

      Most of the neovim config has been like that 😂

    • @sutirk
      @sutirk ปีที่แล้ว +27

      This is not the main channel tho, he's probably gonna put it up on a repo and make a shorter, objective video with all of this + other things he read and configured off stream

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

      @@sutirk probably

    • @witchdoc-xp
      @witchdoc-xp ปีที่แล้ว +12

      I like the process to figure things out. The polished "hey I did it" videos are 99% around

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

      Tell me you don't have a beautiful wife without telling me you don't have a beautiful wife:
      "do this off stream..."

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

    Why use a plugin when you're a masochissst

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

    How does this differ from vscode where everything is managed inside the editor? With nvim you just have to manually configure each LSP server using almost the same boilerplate code - it's terrible. Why Mason can't be an external command line tool and why haven't I seen configuration examples where the LSP server automatically starts based on file types or something else (like Helix does, seriously, you don't need to do anything for it, by default it tries to start the server based on directory contents or file types and has built-in config for almost all servers). Even such a basic thing like choosing a formatter is totally complicated.

    • @levdue6310
      @levdue6310 ปีที่แล้ว +4

      It's hard to change direction in such a big and "old" project, the neovim team can't just throw away what they were doing for years. If you want that use helix, or write your own Text Editor.

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

      what about lsp-zero?

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

      @@levdue6310 nvim-lspconfig is not shipped with NeoVim and it just has no options to automate the attaching of an LSP server, while in Helix you can store language or server specific settings separately and it takes a couple of lines in language.toml file. Writing code like `lspconfig.tsserver.setup()` will also throw an error message when you use your configuration on a machine without tsserver (which actually has a different name, it's just a clumsy alias that you need to find out first) installed. And remember that you need to maintain nvim-cmp for the same servers that you specified in nvim-lspconfig config.

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

      @@dez0rted291 you still have to juggle with nvim-cmp, nvim-lspconfig, mason, mason-lspconfig and call .setup() manually for each server. And also monitor all the breaking changes of lsp-zero.

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

      @@fumanchez I will try to respond to everything you said.
      You: why Mason can't be an external command line tool?
      It's a Neovim plugin, it makes sense for it to run inside Neovim.
      You: why haven't I seen configuration examples where the LSP server automatically starts based on file types or something else?
      You are definitely speaking without knowing, a language server can be configured to attach to a specific file type, or to a list of file types. Also in Neovim you have another option to start a language server in a project, the option is root_dir, it is a list of files that must exist in the root of the project to start a language server, for example for tsserver nvim-lspconfig configure these: tsconfig.json, package.json, jsconfig.json and the directory .git, and these can be modified.
      You: Even such a basic thing like choosing a formatter is totally complicated
      not really, plugins like conform.nvim or formatter.nvim are really easy to use, there is also the builtin vim.lsp.buf.format function that formats using LSP, you can easily create a keymap or a user command to execute that function
      You: nvim-lspconfig is not shipped with NeoVim
      of course, because it is a plugin that offers extra functionality that should not be in the core of neovim, also I think you misunderstand the purpose of that plugin, that plugin helps facilitate configuring a language server, but it is not necessary for that, neovim has a built-in LSP client and you can configure a language server without nvim-lspconfig.
      I suggest you read the article "Neovim journey: using LSP without any plugins!" or another article "Can we manage neovim's LSP client without plugins?", google it, I won't put links here because I think TH-cam eliminates comments with links, although I'm not sure. After reading those articles you will clearly understand how LSP works in Neovim.
      You: while in Helix you can store language or server specific settings separately and it takes a couple of lines in language.toml file
      Neovim and Helix have very different approaches, Neovim tries to give the most basic so that the user can build their own configuration on top, on the other hand Helix in my opinion I think it is more about being a kind of mix between Neovim/Vim and VSCode, it is similar to Neovim/Vim because it runs inside the terminal and has almost the same keybindigs and is similar to VSCode in the sense that it does a lot of things for you under the hood and implements some functionalities natively that in Neovim/Vim are found in the form of a plugin.
      Also VSCode is configured with a JSON, Helix with TOML, very similar, for me personally that is something that does not attract me, I guess I am already very used to Lua, configuring my code editor with JSON or TOML right now for me feels like having my hands tied, I really like the Neovim API and all the functionality it brings.
      You: Writing code like `lspconfig.tsserver.setup()` will also throw an error message when you use your configuration on a machine without tsserver installed
      The error you would probably get is that tsserver is not available in your PATH, which is not Neovim's fault, you have to install the language server and you can use mason.nvim for that, and it is also easy to create a command that install all the language servers you want, for example the :MasonInstall command receives as an argument the language server you want to install and you can pass as many as you want and it will install them all, in my configuration I created the :MasonInstallAll command that takes a list of strings with all the language servers I need, it concatenates them separated by a space, basically what it does is run something like MasonInstall gopls tsserver rust-analyzer.
      You: call .setup() manually for each server
      You can create a list of strings with the names of the language servers and with a for loop iterate it and run setup for each language server, that is what I do in my configuration since 2021, I have never needed lsp-zero or mason-lspconfig , I only use nvim-lspconfig because it offers me some useful defaults and useful commands and mason.nvim because I can install everything I need without problems with an easy-to-use interface.

  • @talananiyiyaya8912
    @talananiyiyaya8912 ปีที่แล้ว +5

    This is soul crushingly boring. Probably more entertaining live.

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

    His voice can be annoying from time to time, but we don't have many alternatives.

  • @艾曦-e4g
    @艾曦-e4g ปีที่แล้ว +5

    Besides lsp, would you like adding some AI stuff? Such as copilot.vim by teep and gen.nvim by david. BTW, will you share the neovim config to your funs? I am looking forward it.