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

  Рет қаралды 50,325

Josean Martinez

Josean Martinez

Күн бұрын

Hey! In this step by step guide, I show you how to setup linting & formatting in Neovim with conform.nvim and nvim-lint in order to replace this specific functionality from the now archived null-ls plugin.
I hope you enjoy it and find it helpful!
🚀 My config: github.com/josean-dev/dev-env...
✍🏽 Step-by-Step Blog Post: www.josean.com/posts/neovim-l...
📧 Email for business inquiries: youtube@josean.com
📹 lazy.nvim tutorial video - • How To Use lazy.nvim F...
📹 How to setup lsp in Neovim - • How I Setup LSP In Neo...
Help Support Me And The Channel: www.buymeacoffee.com/joseanma...
Helpful links:
lazy.nvim: github.com/folke/lazy.nvim
mason.nvim: github.com/williamboman/mason...
mason-tools-installer: github.com/WhoIsSethDaniel/ma...
conform.nvim: github.com/stevearc/conform.nvim
nvim-lint: github.com/mfussenegger/nvim-...
⏰ Timestamps:
00:00 - Introduction
00:38 - lazy.nvim recap
01:52 - Removing null-ls & mason-null-ls
04:21 - Formatting with conform.nvim
13:52 - Linting with nvim-lint
23:58 - Auto installing linters & formatters with mason
24:57 - New colorscheme
26:00 - Conclusion
--------------------------------------------------------------------------------
🖥️ My Desk Setup:
💻 Computer & Monitor
Apple 27” Studio Display for Coding & Video Editing: amzn.to/47YzRZt
2021 M1 Pro Macbook Pro (mine): amzn.to/47XNhoC
2023 M2 Pro Macbook Pro (newest): amzn.to/3qYHG0J
🖱️ Mouse
Apple Trackpad: amzn.to/45P0i1S
Logitech MX Master 3s Mouse: amzn.to/3Z3bXIq
⌨️ Keyboard
Cherry Corne Version 3 Kit: bit.ly/3UJgrjH
Analyst Keyboard Case: bit.ly/3uyjIHQ
Nice!Nano Microcontrollers: bit.ly/3FblL9L
Gateron Ink Black V2 Switches: amzn.to/3YZ3cz9
Batteries for Nice!Nanos: bit.ly/3uBmtrS
Travel Case (Fits Analyst Corne Case): bit.ly/3Hmr7BR
Gateron Ink Black V2 Switches: bit.ly/3VJToX4
My Keycaps: bit.ly/3uHBbgV
Blank PBT Keycaps: bit.ly/3UJhgJ6 or amzn.to/3UNQtLQ
Planck PBT Keycap Set: amzn.to/3HopRhC
You can also find some pre-built options and DIY kits on Etsy: www.etsy.com/search?q=corne
🎧 Headphones
Sony WH-1000XM4 Headphones: amzn.to/3sEJU65
----------------------------------
🎬 My Video Gear:
📹 Camera
My Fuji xt3 Camera (only available used): amzn.to/3P4P1E7
Recommended Cameras:
Fuji xt5 (newest): amzn.to/3P0jMtK
Fuji xt4 (used): amzn.to/3EmeUdt
Fuji 23mm f2 Lens (great for video in smaller spaces): amzn.to/3L2L6pV
Camera Field Monitor: amzn.to/3L2nrpW
🎙️ Audio
Rode VideoMic Pro+: amzn.to/45PecRC
Overhead Camera/Mic Arm: amzn.to/45y8Ryl
💡 Lighting
Aputure Amaran 100d Keylight: amzn.to/47T4Y97
Aputure Light Dome Mini II Softbox: amzn.to/3EstpMM
Aputure Amaran Small RGB Light: amzn.to/3Pl6RnG
IVISII Bright RGB Light: amzn.to/3EmfsA3
---------------------------------------------------------------------------------------------
Links used in the description may be affiliate links. By clicking and/or purchasing from these affiliate links I receive a small commission (at no cost to you). This really helps me out in funding my videos and growing my channel, thank you for the support!

Пікірлер: 109
@joseanmartinez
@joseanmartinez 8 ай бұрын
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!
@r4k4210
@r4k4210 7 ай бұрын
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.
@ayanko
@ayanko Ай бұрын
Exceptional tutorial how to really PROPER configure FORMATTING and LINTING in 2024 !!! Thx a lot!
@elveglos
@elveglos 6 ай бұрын
Thank you Josean for keeping us up to date. Amazing work!
@JT-mr3db
@JT-mr3db 8 ай бұрын
I just spent most of the day following your vids and FINALLY I have the neovim setup I have always wanted. AMAZING!
@joseanmartinez
@joseanmartinez 8 ай бұрын
That’s awesome, happy to hear that!
@kriansa
@kriansa 4 ай бұрын
"Final(ly)" and "(neo)vim setup" are not words that usually go well together.
@user-ze3bc8hw3y
@user-ze3bc8hw3y 8 ай бұрын
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 !!!!
@xzskywalkersun515
@xzskywalkersun515 7 ай бұрын
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!
@ya2138
@ya2138 8 ай бұрын
Very helpful tutorial with a lots of explanation. Thanks a lot!!!
@wojciech-kulik
@wojciech-kulik 8 ай бұрын
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 8 ай бұрын
I really appreciate that! Glad I could help.
@jiboneus
@jiboneus 8 ай бұрын
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,... 😅
@gioelem5957
@gioelem5957 8 ай бұрын
Great job, thank you very much. I switched to Lazy following your videos and I'm loving them
@joseanmartinez
@joseanmartinez 8 ай бұрын
Awesome! Thanks for the feedback, glad you’re enjoying them!
@nikensss
@nikensss 8 ай бұрын
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.
@joseanmartinez
@joseanmartinez 8 ай бұрын
Glad I could help!
@JustFreakazoid
@JustFreakazoid 8 ай бұрын
Extremely useful videos, thanks!
@NickyTheRook
@NickyTheRook 8 ай бұрын
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 4 ай бұрын
Very helpful video for a begginer. Thanks man
@micaelviana
@micaelviana 8 ай бұрын
It's crazy when you think that a single plugin could solve all this on its own. No wonder he got tired
@yesidev4131
@yesidev4131 8 ай бұрын
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 8 ай бұрын
Awesome! Really happy to hear that.
@tiny_mystery
@tiny_mystery 8 ай бұрын
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 !
@hodasalim4237
@hodasalim4237 8 ай бұрын
Thank you ! I have been looking forward to this !
@joseanmartinez
@joseanmartinez 8 ай бұрын
Happy to hear that! Hope you find it helpful!
@JonathanMorrisMusic
@JonathanMorrisMusic 8 ай бұрын
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 8 ай бұрын
Awesome! Appreciate the feedback and support!
@brendon205
@brendon205 7 ай бұрын
Are you using none-ls? I'm wondering if I should use it
@maleldil1
@maleldil1 Ай бұрын
@@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.
@nevermindthelabel
@nevermindthelabel 8 ай бұрын
really appreciate this, had to watch as soon as I saw you posted.
@joseanmartinez
@joseanmartinez 8 ай бұрын
Awesome! Happy to hear that.
@gavenblsn4753
@gavenblsn4753 2 ай бұрын
you truly are an amazing man. thank you and keep up the glorious work. 👍👍👍
@prrockzed
@prrockzed 8 ай бұрын
Was waiting for this video. Thanks a ton!
@joseanmartinez
@joseanmartinez 8 ай бұрын
Glad I could help!
@methuselahmark7818
@methuselahmark7818 7 ай бұрын
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
@AqgvP07r-hq3vu
@AqgvP07r-hq3vu 6 ай бұрын
He saves my life and career.
@qwarlock4126
@qwarlock4126 7 ай бұрын
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!
@annakarolinafranz5946
@annakarolinafranz5946 8 ай бұрын
thanks. Congratulations on the channel, I always follow
@thiagopuntar
@thiagopuntar 8 ай бұрын
I was anxious waiting for this... worked fine here! Thanks man, keep publishing.
@joseanmartinez
@joseanmartinez 8 ай бұрын
Awesome! Happy to hear that.
@blz777
@blz777 8 ай бұрын
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 8 ай бұрын
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" })
4 ай бұрын
Thank you!
@Aicellycut
@Aicellycut 6 ай бұрын
Thank you very much
@bassamsaleh8034
@bassamsaleh8034 8 ай бұрын
thanks a lot, it's very informative video.
@alonso0188
@alonso0188 8 ай бұрын
Thank you man.
@theoldeenglish5789
@theoldeenglish5789 3 ай бұрын
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.
@hungvx-dev
@hungvx-dev 7 ай бұрын
Very helpful tutorial with a lots of explanation. Thanks a lot!!! But, How to auto fix eslint when formatting?
@serhgoch
@serhgoch 8 ай бұрын
Thank you for the video. dial.nvim extends default C-a/C-x movements, e.g. changing true to false and etc
@joseanmartinez
@joseanmartinez 8 ай бұрын
Good to know, thanks!
@themike874
@themike874 28 күн бұрын
I love you, and you conform configuration xd
@IainSimmons
@IainSimmons 8 ай бұрын
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 8 ай бұрын
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 8 ай бұрын
Wow thanks for letting us know about none-ls. I wonder how well it works with mason null-ls
@ciegoavr
@ciegoavr 26 күн бұрын
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)?
@antidotejack2771
@antidotejack2771 8 ай бұрын
very helpfull
@martinhalder7841
@martinhalder7841 7 ай бұрын
Great content, have you tried efm-langserver as a replacement for null-ls?
@aaronhsieh3798
@aaronhsieh3798 7 ай бұрын
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
@vladimirjankauskas3460
@vladimirjankauskas3460 4 ай бұрын
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.
@podgorniy.r
@podgorniy.r 7 ай бұрын
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.
@saabirmohamed636
@saabirmohamed636 3 ай бұрын
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.
@wata1991
@wata1991 8 ай бұрын
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.
@zachmoring284
@zachmoring284 8 ай бұрын
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 8 ай бұрын
Awesome!! I’m using dressing.nvim and love it too! So many cool plugins to discover, thanks for the tips!!
@ecosse31
@ecosse31 8 ай бұрын
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 8 ай бұрын
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.
@xyxytx
@xyxytx 8 ай бұрын
Do you consider to do DAP video?
@gavenblsn4753
@gavenblsn4753 2 ай бұрын
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
@ghosthaunting15
@ghosthaunting15 8 ай бұрын
Finally
@takayumaja9438
@takayumaja9438 Ай бұрын
how to formatting file extenstions .ejs on conform.nvim based style formatting with prettier or etc?
@talio-5469
@talio-5469 8 ай бұрын
Necesitamos mas gente como tu mano. Yo me tiraria pero yo no estoy para showmanship XD
@joseanmartinez
@joseanmartinez 8 ай бұрын
Gracias 🙏🏽
@crusader_
@crusader_ 8 күн бұрын
Does nvim tree show the prompt to create a file by default or is it neotree you're using
@LeungWong
@LeungWong 3 ай бұрын
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?
@aaronmcadam
@aaronmcadam 8 ай бұрын
Great video! Is there a popular plugin for code actions yet?
@joseanmartinez
@joseanmartinez 8 ай бұрын
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!
@idk-nv
@idk-nv Ай бұрын
if i already use eslint_d,is eslint lsp still needed?
@Noah-rm4br
@Noah-rm4br 6 ай бұрын
How do you enable line numbering? Appreciate the video btw! :) Subscribed and liked!
@themohmand
@themohmand 6 ай бұрын
That's just a vim feature, just set this in your config vim opt.number = true
@abdelhakimkhabir
@abdelhakimkhabir 3 ай бұрын
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?
@Sameer_Kumar
@Sameer_Kumar 8 ай бұрын
@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 8 ай бұрын
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.
@ngophuctruong9382
@ngophuctruong9382 8 ай бұрын
Great video! Could you tell me what plugin you use for terminal.Please
@joseanmartinez
@joseanmartinez 8 ай бұрын
Glad you found it helpful! I’m using iTerm2 for the terminal if that’s what you’re referring to
@ngophuctruong9382
@ngophuctruong9382 8 ай бұрын
@@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
@oldcoyote
@oldcoyote 8 ай бұрын
Does anyone know how to do "fix all?". I miss the option from vs code to fix all lint and formatting issues
@ahsanhabib3193
@ahsanhabib3193 8 ай бұрын
Any plan on adding debuggers ...??
@bartek...
@bartek... 5 ай бұрын
none-ls is forked and maintained by community null-ls. It is fully backward compatible, config stays intact.
@thecodealchemist7095
@thecodealchemist7095 8 ай бұрын
Something seems extra with your text selection... Is thst treesitter,-, context-objects?
@joseanmartinez
@joseanmartinez 8 ай бұрын
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.
@adonespitogonaif
@adonespitogonaif 4 ай бұрын
There is a new active fork of null-ls, it's called none-ls.
@a_maxed_out_handle_of_30_chars
@a_maxed_out_handle_of_30_chars 8 ай бұрын
thank you, will give it a try but null-ls is still working i'll switch when it completely breaks :)
@joseanmartinez
@joseanmartinez 8 ай бұрын
Yeah totally understand that!
@TheRuancarlo
@TheRuancarlo 8 ай бұрын
Is none gonna fork null-ls?
@annakarolinafranz5946
@annakarolinafranz5946 8 ай бұрын
Is your repository updated with this video?
@joseanmartinez
@joseanmartinez 8 ай бұрын
Yep!
@adicide9070
@adicide9070 8 ай бұрын
a fork of null-ls is doing fine now, so stay with that.
@driden1987
@driden1987 8 ай бұрын
I needed to update over from null-ls. _Sad_
@joseanmartinez
@joseanmartinez 8 ай бұрын
Yeah same, kinda sad null-ls was archived. Hopefully this solution works well for you.
@driden1987
@driden1987 8 ай бұрын
@@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
@daephx
@daephx 7 ай бұрын
are-chived
@JoshPeterson
@JoshPeterson 29 күн бұрын
*ar-kived, not ar-chived
How To Make An Amazing Custom Menu Bar For Your Mac With Sketchybar
47:54
Making Tmux Better AND Beautiful -- here’s how
10:56
typecraft
Рет қаралды 58 М.
Khóa ly biệt
01:00
Đào Nguyễn Ánh - Hữu Hưng
Рет қаралды 19 МЛН
터키아이스크림🇹🇷🍦Turkish ice cream #funny #shorts
00:26
Byungari 병아리언니
Рет қаралды 15 МЛН
I Built a Shelter House For myself and Сat🐱📦🏠
00:35
TooTool
Рет қаралды 36 МЛН
Neovim Lazy Lua IDE - my simple but powerful setup for 2024
29:13
Null-ls IS BEING ARCHIVED | Prime Reacts
32:02
ThePrimeTime
Рет қаралды 90 М.
LazyVim: Linting and Formatting
9:26
Elijah Manor
Рет қаралды 40 М.
7 Amazing CLI Tools You Need To Try
18:10
Josean Martinez
Рет қаралды 228 М.
How To Make Your Boring macOS Terminal Amazing With Alacritty
16:33
Josean Martinez
Рет қаралды 109 М.
How I Setup LSP In Neovim For An Amazing Dev Experience - Full Guide
34:09
Why I Cant Stand IDE's After Using VIM | Prime Reacts
17:51
ThePrimeTime
Рет қаралды 265 М.
How To Use lazy.nvim For A Simple And Amazing Neovim Config
25:44
Josean Martinez
Рет қаралды 152 М.
How I Setup Neovim To Make It AMAZING in 2024: The Ultimate Guide
1:26:35
Josean Martinez
Рет қаралды 142 М.
Настоящий детектор , который нужен каждому!
0:16
Ender Пересказы
Рет қаралды 434 М.
Main filter..
0:15
CikoYt
Рет қаралды 7 МЛН
Will the battery emit smoke if it rotates rapidly?
0:11
Meaningful Cartoons 183
Рет қаралды 23 МЛН