How To Setup Linting And Formatting In Neovim To Replace null-ls

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

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

  • @joseanmartinez
    @joseanmartinez  ปีที่แล้ว +25

    Hey guys!
    So there's also a community fork for null-ls you can also try called none-ls. I've added this to my config in case you want to stick with that. You'd have to uncomment the event property of the "lsp/none-ls.lua" file if you want to use that and you can disable the alternative approach in this video by commenting this line out in "linting.lua" and "formatting.lua". That's of course if you're using my config as is, but I'd recommend you adapt it to your liking instead.
    I also wanted to point out from the video that the reason I chose conform.nvim over formatter.nvim is how easy and similar it was to nvim-lint and because when using formatters like "prettier", it'll check if you have it installed in node_modules first and execute that instead!

  • @JT-mr3db
    @JT-mr3db ปีที่แล้ว +5

    I just spent most of the day following your vids and FINALLY I have the neovim setup I have always wanted. AMAZING!

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

      That’s awesome, happy to hear that!

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

      "Final(ly)" and "(neo)vim setup" are not words that usually go well together.

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

    Exceptional tutorial how to really PROPER configure FORMATTING and LINTING in 2024 !!! Thx a lot!

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

    It's crazy when you think that a single plugin could solve all this on its own. No wonder he got tired

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

    Great content as usual! Still undecided if I'll use both of these or none-ls as a replacement but really appreciate the walkthrough! Nice to have formatting and linting separated out like this.

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

      Awesome! Appreciate the feedback and support!

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

      Are you using none-ls? I'm wondering if I should use it

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

      @@brendon205 you should continue to use if you were using null-ls IMO. It's a drop-in replacement, an I think it integrates better with the rest of the ecosystem, as it's considered as an internal LSP server, so you can use it with lsp-zero, vim.lsp.buf.format, etc., while conform is completely separate thing.

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

    Thanks for sometimes explaining these git repos. This is much better than the generic "copy this, copy that, pc will go beep boop".

  • @wojciech-kulik
    @wojciech-kulik ปีที่แล้ว

    Man, you are the wizzard! I watched your previous videos and I was thinking "I need to figure out how to setup Swift linter & formatter (which are not available in Mason)". The next day you published the video! THANKS, you make great tutorials!

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

      I really appreciate that! Glad I could help.

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

    I followed your config and works really nice, i really like it. I moved from Astrovim to my own configuration based on yours. Thanks for your amazing work.

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

    Thank you Josean for keeping us up to date. Amazing work!

  • @pierre-malan
    @pierre-malan ปีที่แล้ว +1

    Hey great setup!! I am using a lot of this as you explained and it is working great... Please keep up the good work - Awesome work !!!!

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

    Man Thanks you a lot of, your nvim videos restored my spirits, I had my nvim config with only vimscript, when lua appeared I couldn't understand how to implement, because I couldn't find something concise, each guide I found had different implementations, added to the fact that there was competition between package installers, English is not my native language but Spanish and there was no information in my language so it personally seemed very difficult to stay up to date besides the fact that I had started using new technologies in my work and I didn't have time, I had to go back to vscode, but your videos and your configuration helped me finally understand lua in neovim and make my own configurations, thank you very much

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

      Awesome! Really happy to hear that.

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

    Great job, thank you very much. I switched to Lazy following your videos and I'm loving them

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

      Awesome! Thanks for the feedback, glad you’re enjoying them!

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

    Hi Josean,
    I've followed all your config env videos and must say, I REALLY ENJOY THEM. Having no development experience, your content has sparked my interest in coding. Thank you!
    For your upcoming videos, I'd love to see one on integrating GIT into the workflow, along with some tips on file/folder management for developers. Additionally, code sessions or small demo projects demonstrating the use of those keymaps in a real scenario would be incredibly helpful. As a beginner, it's challenging to remember and implement all those shortcuts.
    Also, I know you don't typically code in Python, but I'm curious if you could create videos on integrating ChatGPT within the terminal environment and developing some projects with it.
    Many thanks and best regards!

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

    you truly are an amazing man. thank you and keep up the glorious work. 👍👍👍

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

    Oh, thank you very much! I was able to make the switch from lsp-zero and null-ls to your settings super quickly. I managed to reconfigure my rust setup (which I did break), and I was even able to use an SQL formatter not supported yet (sleek). Thank you very much!
    I had been looking for a replacement since the author announced the archiving, but I didn't find anything.

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

    Nice! Thanks. Exactly what I was looking for! Now to find a way to use only the tools a certain project uses based on which config files are present. Like only use prettier if a prettierrc exists, only use deno_fmt if a deno.json exists, only use biome if a biome.json exists etc. Thankfully neovim uses lua, so I'm certain I can look up how to conditionally call that format function!

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

    Very helpful video for a begginer. Thanks man

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

    Hay Josean, thanks for making these greate Nvim videos. I've been following a long your videos and the only changes that i've made to my config was to change the theme from night-fly to tokyonight,... 😅

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

    Great video! Just FYI, someone forked null-ls and made a new repo none-ls. LazyVim has already added it as the default since it's meant to be a drop-in replacement.
    Your setup seems faster to me though, so I might give it a try.
    I was also burned by null-ls recently when i tried a few new things, forgot i added them, and then started getting nvim-cmp errors all over the place.
    Took me ages to figure out the source of the issue.
    I like here how you have things split up.

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

      I had no idea! Thanks for letting me know about that. I really enjoyed how easy it was to setup null-ls but I’m enjoying this approach as well, I guess it depends on what you prefer and the specific features you might need. Because I used null-ls solely for linting and formatting, I think it’s nice to have two plugins solely dedicated for that purpose.

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

      Wow thanks for letting us know about none-ls. I wonder how well it works with mason null-ls

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

    I was anxious waiting for this... worked fine here! Thanks man, keep publishing.

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

    Do you consider to do DAP video?

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

    really appreciate this, had to watch as soon as I saw you posted.

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

    Very helpful tutorial with a lots of explanation. Thanks a lot!!!

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

    Great video ! I think it is better to have two seperate plugins. Atleast, I used null-ls for formatting only XD. I was not aware about conform.nvim, thanks for the video !

  • @AqgvP07r-hq3vu
    @AqgvP07r-hq3vu ปีที่แล้ว +1

    He saves my life and career.

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

    Well done, thank you very much for this content!
    The only thing I wish you added to the explanation is how to manually disable linting messages for a file if we find them distracting.
    All the best!

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

      Something along the lines of:
      -- hide virtual text and signs
      vim.keymap.set("n", "mh", function()
      vim.diagnostic.config({ virtual_text = false, signs = false })
      end, { desc = "Manual Hide for virtual text" })
      -- show virtual text and signs
      vim.keymap.set("n", "ms", function()
      vim.diagnostic.config({ virtual_text = true, signs = true })
      end, { desc = "Manual Show for virtual text" })

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

    Thank you so much, great video. Makes it much easier for me to understand how to configure Neovim correctly. But there is still one question: How to setup neovim so that pylint or mypy works correctly in virtual environments.

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

    Thank you ! I have been looking forward to this !

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

      Happy to hear that! Hope you find it helpful!

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

    Was waiting for this video. Thanks a ton!

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

    hi Josean, thank you for this tutorial, I wanted to update my config to add formatter, but could not understand how can I add conform to my kickstart.nvim. This video make it a breeze! thank you so much

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

    At 24:23, wouldn't placing mason-tool-installer as a dependency cause issues given that mason-tool-installer depends on mason? I feel like doing it this way might cause mason-tool-installer to break when it tries to install a linter/formatter but mason isn't loaded yet.

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

    Thanks for all you do. Actually i don't have a pc but i use my mobile and termux to follow along and will love you to do a video showing how to code with Neovim and also open live server at the same time to see changes live. Thank you

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

    Gosh you really have this brilliant way of clearly explaining. You are always moving at a clip but not so fast that one has to constantly move back. Thanks. Great explanation of both linting and formatting setup. By the by, is there any plugin that adds back the Code Actions popup that we lose I believe when we lose null_ls? Thanks again!

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

    Extremely useful videos, thanks!

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

    Hello! Awesome explanation! I have a question regarding eslint setup. What is the benefit of setting it up with lint or null-ls compared to just an eslint-lsp ? It looks like setting it up through lsp provides code actions and requires less additional work of setting it up.

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

    Hello Josean, question, how can i pass format options? lets say I want black to make the line width 100, how can I pass to the formatter

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

    Guys! How do you handle code actions as going with this approach? Thanks for answering

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

    Great content, have you tried efm-langserver as a replacement for null-ls?

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

    have you ever had an issue where you get duplicate diagnostic messages from eslint and the TS lsp? If you have any suggestions would be great.

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

    Thank you so much for the tutorial!!
    Want to know if I use clang_format for C++, how can I configure the file to change the indentation for this formatting

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

    thanks. Congratulations on the channel, I always follow

  • @talio-5469
    @talio-5469 ปีที่แล้ว

    Necesitamos mas gente como tu mano. Yo me tiraria pero yo no estoy para showmanship XD

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

    Is none gonna fork null-ls?

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

    Any plan on adding debuggers ...??

  • @hungvx-dev
    @hungvx-dev ปีที่แล้ว

    Very helpful tutorial with a lots of explanation. Thanks a lot!!!
    But, How to auto fix eslint when formatting?

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

    Does nvim tree show the prompt to create a file by default or is it neotree you're using

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

    Thanks you a lot of, your nvim videos helps me to understand how the packages works. Do you know how to setup neovim so that pylint works within a virtual environment (e.g. conda)?

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

    Thank you for the video. dial.nvim extends default C-a/C-x movements, e.g. changing true to false and etc

  • @podgorniy.r
    @podgorniy.r ปีที่แล้ว

    Hello Josean, could you please help me with the bufferline configuration? How did you configure the transparent fill for the background next to the tabs? Previously, you had a black fill, but now it's darker than the tabs, and in addition to that, it's transparent.

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

    Great video! Could you tell me what plugin you use for terminal.Please

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

      Glad you found it helpful! I’m using iTerm2 for the terminal if that’s what you’re referring to

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

      @@joseanmartinez So happy to receive your answer. But i mean it is the terminal in Vim , like floaterm plugin, i can't find any way to configure it with lua. Can you give me some suggestion

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

    thanks a lot, it's very informative video.

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

    Great video! Is there a popular plugin for code actions yet?

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

      Well null-ls which is now none-ls which was forked by the community, has better support for code actions. There’s also a language server for eslint you can try to use it through the lsp. What I talk about in the video is more for just showing linting errors. Hope that helps!

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

    stevearc's stuff is all great. Aerial is one of my most-used plugins, Dressing is basically a requirement for Telescope so you can use the Telescope elements for selectors and such, and Oil is my favorite file editor. All of it is so good.

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

      Awesome!! I’m using dressing.nvim and love it too! So many cool plugins to discover, thanks for the tips!!

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

    nvim-lint doesn't seem to support code actions to fix lint issues automatically, something which null-ls/none-ls had. do you have some alternative for it, or do you simply not use that feature inside nvim?

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

    Thank you very much

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

    That's amazing! I'll definitely bring it to my nvim config. How it works with lsp? For example, if I have eslint lsp, eslint config file in project and I run :ESLintFixAll command, is it has more priority than eslint_d linter? Do they work together?

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

      I'm honestly not entirely sure. I would imagine that the :EsLintFixAll command would youse the eslint lsp, but I haven't tried that out.

  • @bartek...
    @bartek... ปีที่แล้ว

    none-ls is forked and maintained by community null-ls. It is fully backward compatible, config stays intact.

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

    How can we make the linter not match the color of the text it highlights, but instead underline mistakes in red and suggestions in blue?

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

    I love you, and you conform configuration xd

  • @idk-nv
    @idk-nv 8 หลายเดือนก่อน

    if i already use eslint_d,is eslint lsp still needed?

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

    Thank you!

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

    Can I set always linting on like live linting, that keeps showing wrong untill I correct it and without goin toh normal mood? Thanks

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

    why is the error is being shown twice ? and also the errors are usually overflowing. how to avoid this?

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

    Something seems extra with your text selection... Is thst treesitter,-, context-objects?

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

      I’m mostly using Shift+V to select whole lines in visual mode and moving down several lines depending on what I need to select.

  • @Noah-rm4br
    @Noah-rm4br ปีที่แล้ว

    How do you enable line numbering?
    Appreciate the video btw! :) Subscribed and liked!

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

      That's just a vim feature, just set this in your config
      vim opt.number = true

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

    Hi,
    Well done.
    But I never heard saying you will not have code actions like none-ls/null-ls/ale etc. and it's useless to have errors reported with no action, I mean I have them in CLI, mainly because I use cspell so I need code actions too.
    However, this is a good tutorial to configure with how and why.

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

    Thanks for for this video so helpful ,
    can you make a video on how to add the flutter tools plugin...(so flutter dart lsp...)
    I've been trying various configs ... but i can get it to run well.

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

    How there are show errors in code like vs code

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

    how to formatting file extenstions .ejs on conform.nvim based style formatting with prettier or etc?

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

    Is your repository updated with this video?

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

    @joseanmartinez Good work here, especially informing about the mason integration. I have one problem though, let's say as for your config, eslint_d gives offenses like let const, but there isn't any code actions. As far as I remember, eslint does correct offenses.
    Any ideas on this?

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

      Thanks for the feedback! Yea nvim_lint doesn’t have support for code actions as it’s just for displaying linting errors inside Neovim, for something like eslint there’s also a eslint language server you can try or I also heard about a community fork for null-ls called none-ls recently. I’m not entirely sure how well eslint code actions worked through null-ls as I didn’t use them very often.

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

    Thank you man.

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

    Does anyone know how to do "fix all?". I miss the option from vs code to fix all lint and formatting issues

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

    thank you, will give it a try but null-ls is still working
    i'll switch when it completely breaks :)

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

    There is a new active fork of null-ls, it's called none-ls.

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

    very helpfull

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

    I needed to update over from null-ls.
    _Sad_

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

      Yeah same, kinda sad null-ls was archived. Hopefully this solution works well for you.

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

      @@joseanmartinezI recently started a new University project and could swear my linting was working fine. It was not, I'm under a ton of errors right now heheh.
      Thanks again, love your vids, love who you go through everything, keep it up, you're doing great

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

    Finally

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

    a fork of null-ls is doing fine now, so stay with that.

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

    *ar-kived, not ar-chived

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

    are-chived

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

    Great tut. I appreciate your attention to detail and how you don't rush through an explanation. I got conform working via key mapping but unfortunately the auto save doesn't work. The callback is being called but it doesn't format. My neovim installation is based off of the Lazyvim project and I was wondering if you might have heard from others who are also struggling to get auto save working. In any case, really like your style of presenting and thanks for sharing.