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

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

Josean Martinez

8 месяцев назад

50,167 Просмотров

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


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

@joseanmartinez
@joseanmartinez - 02.10.2023 15:54

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!

Ответить
@Aicellycut
@Aicellycut - 16.12.2023 17:38

Thank you very much

Ответить
@giovannifiori
@giovannifiori - 06.12.2023 15:56

I've been using nvimdev/guard.nvim for both linting and formatting and it's a breeze too! If I start noticing some buggy behavior than I'll give this config a try. Thanks for the video!

Ответить
@AqgvP07r-hq3vu
@AqgvP07r-hq3vu - 03.12.2023 17:40

He saves my life and career.

Ответить
@elveglos
@elveglos - 27.11.2023 01:09

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

Ответить
@Noah-rm4br
@Noah-rm4br - 26.11.2023 23:31

How do you enable line numbering?

Appreciate the video btw! :) Subscribed and liked!

Ответить
@methuselahmark7818
@methuselahmark7818 - 17.11.2023 20:36

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

Ответить
@xzskywalkersun515
@xzskywalkersun515 - 14.11.2023 05:09

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!

Ответить
@qwarlock4126
@qwarlock4126 - 09.11.2023 06:14

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!

Ответить
@r4k4210
@r4k4210 - 08.11.2023 01:19

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.

Ответить
@daephx
@daephx - 07.11.2023 00:44

are-chived

Ответить
@hungvx-dev
@hungvx-dev - 01.11.2023 07:16

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

Ответить
@seshadribasava2801
@seshadribasava2801 - 30.10.2023 16:58

Hi Thanks for another great video. I got my ultimate setup. I have one question about nvim-lint. How do I see what clients have attached for the current buffer ? like formatter and linter. in Null-ls, there is a command called :NullLsInfo. I want to be able to see if the clients have actually attached to the buffer. I searched everywhere in the nvim-lint repo, couldn't find anything. Can you shed some light on this ?
Thanks in advance.

Ответить
@rostislavpodgorniy3974
@rostislavpodgorniy3974 - 28.10.2023 15:47

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.

Ответить
@aaronhsieh3798
@aaronhsieh3798 - 28.10.2023 01:54

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

Ответить
@martinhalder7841
@martinhalder7841 - 25.10.2023 10:28

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

Ответить
@antidotejack2771
@antidotejack2771 - 23.10.2023 22:14

very helpfull

Ответить
@ya2138
@ya2138 - 21.10.2023 06:24

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

Ответить
@user-ze3bc8hw3y
@user-ze3bc8hw3y - 19.10.2023 21:45

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 !!!!

Ответить
@TheRuancarlo
@TheRuancarlo - 18.10.2023 04:41

Is none gonna fork null-ls?

Ответить
@kapral18
@kapral18 - 17.10.2023 11:22

nvim_create_augroup has {clear = true} by default btw. Awesome vid as always.

Ответить
@blz777
@blz777 - 16.10.2023 23:46

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!

Ответить
@wata1991
@wata1991 - 13.10.2023 10:28

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.

Ответить
@jiboneus
@jiboneus - 12.10.2023 06:31

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,... 😅

Ответить
@ahsanhabib3193
@ahsanhabib3193 - 09.10.2023 17:01

Any plan on adding debuggers ...??

Ответить
@alonso0188
@alonso0188 - 09.10.2023 05:13

Thank you man.

Ответить
@oldcoyote
@oldcoyote - 07.10.2023 00:59

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

Ответить
@JT-mr3db
@JT-mr3db - 06.10.2023 16:55

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

Ответить
@yesidev4131
@yesidev4131 - 06.10.2023 07:02

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

Ответить
@nikensss
@nikensss - 06.10.2023 01:36

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.

Ответить
@JonathanMorrisMusic
@JonathanMorrisMusic - 05.10.2023 21:51

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.

Ответить
@gioelem5957
@gioelem5957 - 05.10.2023 16:01

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

Ответить
@wojciech-kulik
@wojciech-kulik - 04.10.2023 20:32

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!

Ответить
@aaronmcadam
@aaronmcadam - 03.10.2023 23:55

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

Ответить
@EmileNani
@EmileNani - 03.10.2023 21:06

There's a community maintained fork of null-ls named none-ls being maintained by folke and some others. You all should check it out. After switching to nvim-lint, I've just switched back to none-ls

Ответить
@xiangkunyang
@xiangkunyang - 03.10.2023 06:38

Do you consider to do DAP video?

Ответить
@micaelviana
@micaelviana - 02.10.2023 19:38

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

Ответить
@adicide9070
@adicide9070 - 02.10.2023 15:03

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

Ответить
@NickyTheRook
@NickyTheRook - 02.10.2023 02:53

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!

Ответить
@ngophuctruong9382
@ngophuctruong9382 - 02.10.2023 01:38

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

Ответить
@noobnoob3908
@noobnoob3908 - 01.10.2023 19:56

Hi Josean. Thank yuo for this video. I have a question and I hope you can answer this

In null-ls I'm able to config clang_format like this:
formatting.clang_format.with({
extra_args = {
"-style={BasedOnStyle: Google, IndentWidth: 4}",
},
}),
and it works well

I cant make it in conform.nvim

I tried this but it didn't work:
c = {
{
"clang_format",
"-assume-filename",
"$FILENAME",
"-style={BasedOnStyle: Google, IndentWidth: 4}",
},
},

Ответить
@bassamsaleh8034
@bassamsaleh8034 - 01.10.2023 18:49

thanks a lot, it's very informative video.

Ответить
@JustFreakazoid
@JustFreakazoid - 01.10.2023 16:45

Extremely useful videos, thanks!

Ответить
@Sameer_Kumar
@Sameer_Kumar - 01.10.2023 11:20

@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?

Ответить
@tiny_mystery
@tiny_mystery - 01.10.2023 08:59

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 !

Ответить
@user-en1ik6um6f
@user-en1ik6um6f - 01.10.2023 05:51

Amazing as usual. 😊

Did you try zellij instead of tmux? I tried and it has some cool features but I found it hard to navigate through panes.

Ответить
@talio-5469
@talio-5469 - 01.10.2023 02:40

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

Ответить
@zachmoring284
@zachmoring284 - 01.10.2023 02:38

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.

Ответить
@thecodealchemist7095
@thecodealchemist7095 - 01.10.2023 00:56

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

Ответить
@IainSimmons
@IainSimmons - 01.10.2023 00:31

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.

Ответить