LazyVim: Linting and Formatting

Поделиться
HTML-код
  • Опубликовано: 6 июл 2024
  • This is a video about LazyVim: Linting and Formatting where I'll introduce a few baked-in linters and formatters in LazyVim, show how to navigate diagnostics, how to fix problems, and then add your own custom linters.
    If you liked this video, please like and subscribe for further content.
    You can also join as a member of this channel for special perks youtube.com/@elijahmanor/join
    If you'd like to connect on social media, you can find me on Twitter / elijahmanor and Mastodon hachyderm.io/@elijahmanor and Bluesky bsky.app/profile/elijahmanor.com
    #neovim #nvim #vim #terminal #commandline
    0:00 Introduction
    0:08 Native Lua Formatting
    0:34 TypeScript Formatting
    1:26 ESLint
    4:12 Navigating and Fixing Diagnostics
    5:44 Prettier Formatting
    8:08 Other Linters
    9:11 Conclusion
  • НаукаНаука

Комментарии • 159

  • @brattonross
    @brattonross Год назад +13

    Great video :) I like how you go into how LazyVim does this under the hood using mason and null-ls. Looking forward to more

    • @ElijahManor
      @ElijahManor  Год назад +4

      Thank you, yeah I wanted to remove some of the magic and help watchers know what things to look for when things work or don't work. Glad you found that helpful. Thank you for watching and having interest in the channel. Have a great rest of your week!

  • @pnavais
    @pnavais Год назад +4

    And another gem of a video ! Superb as always. I bless the day YT algorithm recommended me Elijah’s channel ❤. This is an absolute must for all terminal lovers 🎉

    • @ElijahManor
      @ElijahManor  Год назад +1

      Wow, that is quite the praise! Well, it is people like you that make this place awesome! Thank you for watching and being such an excited and supportive viewer. Have an awesome rest of your week

  • @MySachincool
    @MySachincool 6 месяцев назад

    this is very underrated video, I loved your content. Learnt a lot!! Thank you

  • @lpanebr
    @lpanebr Год назад +1

    Excellent! Another great content to my list of strong "things" I need to add to me lazy config when I stop being so lazy about it!

    • @ElijahManor
      @ElijahManor  Год назад +1

      Thanks! I guess "lazy" is fitting in this case ha ha. Having priorities is a good thing. Have a great rest of your week

  • @stoicfloor
    @stoicfloor Год назад +1

    Awesome! I always learn something new from your videos! Thank you so much!

    • @ElijahManor
      @ElijahManor  Год назад

      Yay, I love that you love to learn! I do too :) Appreciate your excitement and for your support of the channel.

  • @maninalift
    @maninalift Год назад +1

    Perfect. I was just thinking that i don't want to read a lot to find out how to get rust clippy working with lazyvim. Now i can watch this while I'm cooking

    • @ElijahManor
      @ElijahManor  Год назад

      I like the idea of someone watching one of my videos while cooking dinner. Also, thanks for your interest and I hope it is helpful. Appreciate your time and comment. And, enjoy that dinner!

  • @mazzu83
    @mazzu83 Год назад

    Another content explained very well. Thanks

    • @ElijahManor
      @ElijahManor  Год назад +1

      Thank you and loving the emoji flare!

  • @Redyf
    @Redyf Год назад

    Your channel is great, keep up the good work Elijah!

    • @ElijahManor
      @ElijahManor  Год назад +1

      YAY, thanks :) Have an awesome rest of your day

    • @Redyf
      @Redyf Год назад

      @@ElijahManor you too 😄

  • @kamehameha38
    @kamehameha38 Год назад

    Awesome video as always

    • @ElijahManor
      @ElijahManor  Год назад

      Thank you, appreciate the encouragement and your support. Glad you enjoyed it

  • @sp3ctum
    @sp3ctum 4 месяца назад

    This was really helpful for me. I found the lazyvim documentation extremely confusing whereas this was very clear.

  • @ErmandDurro
    @ErmandDurro Год назад

    As always, great content 💯

    • @ElijahManor
      @ElijahManor  Год назад +1

      Thank you very much :) Working on new content for Mon or Tue. And will have another the following week, which isn't my typical cadence, but I wanted to sprinkle in something else too. Keep an eye out

    • @ErmandDurro
      @ErmandDurro Год назад

      @@ElijahManor will definitely do. Thanks a lot for the hard work 💪

  • @asezen77
    @asezen77 Год назад

    Thanks, great video!

    • @ElijahManor
      @ElijahManor  Год назад

      Wow, thank you so much! Glad it was helpful to you

  • @mssafy2592
    @mssafy2592 5 месяцев назад

    Thank you so much !

  • @albertkovtoun1569
    @albertkovtoun1569 Год назад +1

    Super usefull. Thanks!

  • @ant1fact
    @ant1fact Год назад

    Thank you so much I was banging my head against the wall how to get autoformatting for html files then you come along :D

    • @ElijahManor
      @ElijahManor  Год назад

      Yay, so glad that the video was helpful!

  • @NateInTech
    @NateInTech Год назад +1

    Thanks for the video, I went through a lot of hell trying to get Prettier setup, as I am going through some React courses. I'll need to go back and cross reference things with this video.

    • @ElijahManor
      @ElijahManor  Год назад

      The ecosystem has moved a lot over the years both in the underlying Neovim APIs and also the community plugins, so I totally get you! I appreciate you watching and supporting the channel. Have an awesome day!

  • @ejreillyxyz
    @ejreillyxyz Год назад

    Awesome content, love your videos! I'd love to see an updated video on your tmux config, it is looking saWEEEEET!

    • @ElijahManor
      @ElijahManor  Год назад

      Ah thanks! Yeah, I do plan on making more videos from the tmux (those are on my backlog)... the idea was to have 2 more in the series (at least) at showing how to customize config, then use plugins. Then maybe another with custom plugins. I've also been toying with Zellij which is fun, but comes with it's own challenges if you are used to tmux.

    • @ejreillyxyz
      @ejreillyxyz Год назад

      @@ElijahManor I like what zellij is doing and may switch in the future, persistent sessions are hard for me to let go but I'm sure zellij has workflows that would help me achieve similar things. Definitely keeping an eye on it though! I am happy right now with using oh-my-tmux as a base and then tweaking it as I like, but it does result in an awfully long template config that is not enjoyable to maintain and difficult to tweak in some ways - so I'm very curious how you set it up :)
      Separately, I'd love to see a dotfiles video in the future too! I'm a big fan of chezmoi right now but I think the bare repo approach is awesome too. Your style of teaching is great and easy to follow, thanks again for making all the content :)

  • @emmanuellmiqueletti7029
    @emmanuellmiqueletti7029 Год назад +1

    You're the Vim Hero!

    • @ElijahManor
      @ElijahManor  Год назад

      Yay, and thank you very much for your support!

  • @shiva.sharan
    @shiva.sharan Год назад

    cool stuff🎉

    • @ElijahManor
      @ElijahManor  Год назад

      Always appreciate your excitement and support!

  • @iceystyle2-cu1ob
    @iceystyle2-cu1ob Год назад

    I love your videos

    • @ElijahManor
      @ElijahManor  Год назад

      Thank you so much and I appreciate your sub, excitement, and support!

  • @inteliconn995
    @inteliconn995 Год назад

    Thanks!

  • @macmanuelodumeru3708
    @macmanuelodumeru3708 Год назад +2

    I love your lazyvim videos. You made me switch from Webstorm into lazyvim and I love it. Thank you.
    I've also been waiting for this video for a million years lol. And I'm eager to see what you have in store next for lazyvim haha.
    I have 3 questions though.
    1. How can I remap and use Tab and Shift + Tab to cycle through completions in lazyvim?
    2. How do I increase the speed of the mini animate plugin.
    3. How do I remap the motion keys for neotree?
    Help on any of those would be awesome, thank you sir

    • @ElijahManor
      @ElijahManor  Год назад +2

      I've not tried super tab, but there is a recipe in the LazyVim docs for that www.lazyvim.org/configuration/recipes#supertab
      As for speeding up the mini animate plugin, you can redefine that plugin and adjust the timing functions. Here is a snippet from the docs github.com/echasnovski/mini.animate/blob/main/doc/mini-animate.txt but it would look a bit different using the lazy.nvim syntax.
      local animate = require('mini.animate')
      animate.setup({
      cursor = {
      timing = animate.gen_timing.linear({ duration = 100, unit = 'total' })
      },
      })
      I'd take a look at the LazyVim docs for guidance on how it was setup www.lazyvim.org/plugins/extras/ui.mini-animate#minianimate
      As for neo-tree, I'd take a look at the LazyVim docs www.lazyvim.org/plugins/editor#neo-treenvim and then adjust the
      window = { mappings = {} }
      See the docs from neo-tree for guidance github.com/nvim-neo-tree/neo-tree.nvim#quickstart
      Hope that helps. I'm at the hospital atm with my Mom after surgery so I haven't tried the above tweaks yet, but that is how I would go about it. Hope that helps! Have a great rest of your week

    • @macmanuelodumeru3708
      @macmanuelodumeru3708 Год назад

      ​@@ElijahManor
      ​Thank you so much. This really helped alot in helping me set them up.
      Wishing speedy recovery.

    • @ElijahManor
      @ElijahManor  Год назад +1

      @@macmanuelodumeru3708 glad that was helpful and my mom is recovering well, thank you!

  • @azdanov
    @azdanov Год назад +2

    I'd be interested in a "masterclass" type of a video, where you show how you usually code, which keys you use, and which plugins, your workflows. Maybe different languages, backend/frontend. Slowed down of course 😄. You did show a bunch in Zero to IDE video, yet I'm looking forward to learning more from someone experienced with vim 🙂.

    • @ElijahManor
      @ElijahManor  Год назад +1

      I do have an idea like that listed in my backlog. More like a "There is a bug and let me show you how I go about fixing it" which would probably include stuff like using git, searching, movements, testing, etc... I'd prob use a multiplexer as well.

    • @azdanov
      @azdanov Год назад

      @@ElijahManor Ohh, sounds awesome!

  • @esra_erimez
    @esra_erimez Год назад

    Subbed *with* alerts.

    • @ElijahManor
      @ElijahManor  Год назад

      Awesome, thank you! Have a great rest of your week

  • @frankfromfresno
    @frankfromfresno 5 месяцев назад

    Just Wondering, are you going to be doing an Update Version, with the Conform.nvim & Nvim-Lint. How to Set-Up Formatters & Linters configuring with those

  • @nathanp3366
    @nathanp3366 11 месяцев назад +1

    I always had trouble adding new things like null ls entries to these batteries included configs. Thanks for making great example videos like this to help. Is this just how null-ls is configured for all neovim users, or is this specific to lazy vim?

    • @ElijahManor
      @ElijahManor  11 месяцев назад

      Glad it helped! Well, part of it is specific to LazyVim because the extra files are provided by LazyVim, however the general concepts and underlying files could most likely be reused for non-LazyVim because they built upon lazy.nvim which is a plugin manager that many distros use these days (instead of packer). With that said, the future of null-ls is in question as the author decided to stop maintaining the project. If you stick with LazyVim you should be okay because folke (the maintainer) plans to make sure there is a path forward (whatever that might be). I've been on vacation the past week or so, so I'm a little out of the loop atm.

  • @ChillAutos
    @ChillAutos 7 месяцев назад

    I’d love if you showed a history of keys pressed instead of them disappearing as soon as you press the next one. Nice video in any case

  • @magnusolender7581
    @magnusolender7581 Год назад

    I would love something similar for Vale and Markdownlint as I've been pulling my hair out trying to figure out how to set them up properly

  • @samarnagar9699
    @samarnagar9699 6 месяцев назад

    Hey was just wondering how would you do this from the Kickstart nvim

  • @sanjayshiradwade
    @sanjayshiradwade Год назад +1

    Great video 🔥, Video request: golang and python Linting, Formatting and debugging

    • @ElijahManor
      @ElijahManor  Год назад

      I have barely tinkered with Golang and Python, so I have a LOT to learn in those areas.
      I did find this recent video of someone sharing their 2023 setup for Go ruclips.net/video/LbsILONOaiE/видео.html He uses packer and doesn't use LazyVim, but it seems the pain parts the LSP and the vim-go plugin
      If that is true, then something like the following should work in LazyVim. I'd make a new file in the ~/.config/nvim/lua/plugins folder called golang.lua
      return {
      { 'fatih/vim-go' },
      {
      "neovim/nvim-lspconfig",
      opts = {
      servers = {
      gopls = {},
      },
      },
      },
      }
      As for Python, I'd probably go with pyright for the LSP, flake8 for the linter, and black for the formatter.
      As for debugging, I do plan on having a video about that. It is def on my list of items for the LazyVim playlist. Thanks for watching and for your interest

  • @nachovc
    @nachovc Год назад +1

    Next, let's do debugging :)
    Nice vid!

    • @ElijahManor
      @ElijahManor  Год назад +1

      Thanks! And that topic is def on the list, but not next in line. The trick with that one is there are a lot of different languages viewers want to see (TypeScript, Rust, Golang, Python, C++, etc). I'll prob focus on one of those and hopefully enough is similar or I can point to docs for the others. Also, I'm not very knowledgeable about some of those languages so that could be *interesting* ha ha.

    • @nachovc
      @nachovc Год назад

      @@ElijahManor That makes sense. I had to try hahahah. Thank you!

  • @JarrodHenry
    @JarrodHenry Год назад +1

    I know I would probably be better learning this myself, but can you post your config for (or is it already posted for) the write-good, alex , and proselint combo you used?

    • @ElijahManor
      @ElijahManor  Год назад

      This is completely reasonable! I was creating a GitHub repo per video, but I think it would be better to have ONE lazyvim repo and having branches for each video. Doing all that conversion might take me a bit, but in the meantime here is a gist with that file... gist.github.com/elijahmanor/5d7db1884c40e354406b6eb3d1e12dc4

    • @JarrodHenry
      @JarrodHenry Год назад

      @@ElijahManor Absolutely appreciated! Thank you!

  • @nevilabrahamelias6631
    @nevilabrahamelias6631 10 месяцев назад

    Can you also tell us how to setup prettier with kickstart neovim. Installing with Mason doesn't give the same behaviour that VS code does

  • @meus78
    @meus78 Год назад

    Love the content!
    Would it be possible to do a video on how to set this up for golang?

    • @ElijahManor
      @ElijahManor  Год назад

      I have barely tinkered with Golang, so I have a LOT to learn in that area.
      I did find this recent video of someone sharing their 2023 setup for Go ruclips.net/video/LbsILONOaiE/видео.html He uses packer and doesn't use LazyVim, but it seems the pain parts the LSP and the vim-go plugin
      If that is true, then something like the following should work in LazyVim. I'd make a new file in the ~/.config/nvim/lua/plugins folder called golang.lua
      return {
      { 'fatih/vim-go' },
      {
      "neovim/nvim-lspconfig",
      opts = {
      servers = {
      gopls = {},
      },
      },
      },
      }

  • @npradeeptha
    @npradeeptha Год назад +1

    booped! Are you planning to build up a vanilla lazyvim install with your examples? If not, could you consider that and share? It's easier to follow along that way. Thank you for your videos! I just moved from Doom Emacs to lazyvim so this series is very timely!

    • @ElijahManor
      @ElijahManor  Год назад +1

      Thanks for the boop! I had another person ask something similar. I was making new repos for some of the videos, but I think it would be better for me to have one lazyvim repo for the series and make branches for each one. That might take me a bit, so in the meantime here is a gist with the contents of the writing.lua file gist.github.com/elijahmanor/5d7db1884c40e354406b6eb3d1e12dc4

    • @npradeeptha
      @npradeeptha Год назад

      @@ElijahManor thank you!

  • @khaledmaruf5813
    @khaledmaruf5813 10 месяцев назад

    My Prettier formatting doesn't work at all for some reason. I tried to do as you said, my react App.js/App.jsx, nothing gets formatted. Any Hint!

  • @amberly6559
    @amberly6559 9 месяцев назад

    If I add the tailwindcss prettier plugin to my prettierrc file it breaks prettier formatting and the plugin also doesn't work. If I use the prettier cli command to run the plugin that works, I've been googling this for like two hours and can't seem to find a solution. Would very much appreciate it if you could help with this issue I'm new to coding in general and very new to neovim. Thanks!

  • @trancongminh2628
    @trancongminh2628 4 месяца назад

    how I can format on save typescript by eslint file config?

  • @buttstabber
    @buttstabber 6 месяцев назад

    is there a github repo where we can copy and paste the code?

  • @nathalyaricci
    @nathalyaricci Год назад +1

    Great video!
    Which theme were you using on it?

    • @ElijahManor
      @ElijahManor  Год назад +1

      I'm pretty sure for that video I was just using the baked-in LazyVim theme which is tokyonight github.com/folke/tokyonight.nvim. However, I also use catppuccin github.com/catppuccin/nvim which I may have had turned on in that video. Either one of those are pretty great. I also generally like dracula github.com/Mofiqul/dracula.nvim

    • @nathalyaricci
      @nathalyaricci Год назад

      @@ElijahManor Oh, so it really was tokyonight hahaha I switched it when I installed Lazyvim. Gonna give it a chance 😁 Thank you!

    • @ElijahManor
      @ElijahManor  Год назад

      @@nathalyaricci No problem! Have an awesome weekend

    • @nathalyaricci
      @nathalyaricci Год назад

      @@ElijahManor You too !

  • @vaisakhkm783
    @vaisakhkm783 Год назад

    @ElijahManor i got that link for your next video is from your "Terminal Rocks" playlist...
    also today i switched to LazyVim :) thanks for this video....

    • @ElijahManor
      @ElijahManor  Год назад

      Ha, wow I didn't think that through. Didn't think anyone would see that until I marked it as public. But yeah, I put it on a playlist. Lesson learned ha ha. Glad you watched the videos and that you like LazyVim :) Also, congrats on being first to watch that other video ha ha ha. It'll launch on Saturday morning for others to watch

    • @vaisakhkm783
      @vaisakhkm783 Год назад +1

      @@ElijahManor 😆

    • @ElijahManor
      @ElijahManor  Год назад

      @@vaisakhkm783 btw, I'll answer your other comment after it gets officially launched (if it's still there). If somehow it got deleted, please leave the comment again. I forget all that you said. I was more shocked that someone left a comment ha ha. Have a great rest of your week

    • @vaisakhkm783
      @vaisakhkm783 Год назад +1

      @@ElijahManor 😅 Np... i didn't asked a question... i was telling wrap is a good concept, but it does not treat everything as a 2d char grid... so traditional tooling might fail... like vim in your case... :) lets see will it become as popular as alacrity or kitty once the hype is over....

    • @ElijahManor
      @ElijahManor  Год назад +1

      @@vaisakhkm783 ah gotcha. yeah, i've communicated a lot of my thoughts with the team. i also look forward to seeing how it improves over time. my top 3 requests are better rendering, tmux support, and font fallback. i use several TUIs and they all seemed to work, but they might be a bit off on alignment, etc...

  • @macmanuelodumeru3708
    @macmanuelodumeru3708 Год назад +1

    Hey Vim hero!
    I wanted to ask, is it normal for code action null-ls to run after every single keystroke?
    If not is there a way to limit it as it seems to be affecting performance in that some times keys i press get skipped because code action null ls ran at the same time i pressed the key.

    • @ElijahManor
      @ElijahManor  Год назад +1

      Hmm, which code action are you referring to? Which item did you register with null-ls to have a code action?

    • @macmanuelodumeru3708
      @macmanuelodumeru3708 Год назад +1

      @@ElijahManor I'm not sure. I'm just using the defaults for JavaScript that comes preinstalled with Lazyvim. Although I did add some plugins like auto save
      If I press any key, be it in Normal, Insert or Visual mode or even if I am clicking with my mouse, I always see the notification at the bottom right corner saying "code_action null-ls" with a blue tick. And it's interfering with and lagging my typing.

    • @ElijahManor
      @ElijahManor  Год назад +1

      @@macmanuelodumeru3708 hmm, guess I’d need to see your setup. You have your dot files in a repo?

  • @CZiNTrPT
    @CZiNTrPT Год назад

    How do you know which extra plugins are available? I missed that part in the video

    • @ElijahManor
      @ElijahManor  Год назад

      Great question! There is an Extras section in the LazyVim docs that lists them. Over the past several months new ones keep being added so it's a good place to look now and then www.lazyvim.org/plugins/extras/formatting.prettier

  • @iatheman
    @iatheman Год назад

    I love using neovim. Even better when things work. It’s when things don’t work that it gets extra hard. And things don’t work more than I like to admit.

    • @ElijahManor
      @ElijahManor  Год назад +1

      I enjoy it too. What types of things have you been having trouble with? Maybe I can help in some way. Thanks for stopping by the channel. Hope you have a great rest of your week!

    • @iatheman
      @iatheman Год назад

      @@ElijahManor Thanks for offering to help! I’ll put my LazyVim config online when I have some time. But after trying to config typescript lsp, linting, and formatting, thinks went south and even lua files stopped formatting haha. So this video helps a lot.

    • @ElijahManor
      @ElijahManor  Год назад

      @@iatheman sounds good. I’ll keep an eye out for a future message from you. I’m currently out of town at the hospital with a family member, so my response time could be slower than normal

    • @iatheman
      @iatheman Год назад

      @@ElijahManor Thanks again. Best wishes to you and you family member.

  • @thomaspiechulek535
    @thomaspiechulek535 3 месяца назад

    Hey maybe you can hely... how can i set max line length for formatters like yapf

  • @zindev
    @zindev 7 месяцев назад

    null-ls is no more available by default and the project was archive. What to do now? Please, help us!

  • @matteostara
    @matteostara Год назад

    Good timing! I'm working on a project where I'm not allowed to format scss but I'd still like to use prettier for JS. How would I go about that?

    • @abhijeet.srivastava
      @abhijeet.srivastava Год назад +1

      you can specify which file formats you do not want to format

    • @ElijahManor
      @ElijahManor  Год назад

      Love that others are responding before me. Yes, you can customize a lot of settings for prettierd. I hadn't responded yet because I wanted to get a detailed explanation with code examples, etc. I'm at work right now, but will work on that tonight and respond in more detail. I'm getting this type of question for other scenarios too, so I'd like to take focused time to respond. Thank you for your interest and support

    • @matteostara
      @matteostara Год назад

      @@ElijahManor Absolutely 💯

    • @ElijahManor
      @ElijahManor  Год назад

      Okay, here are some thoughts about some more advanced tweaks for prettier gist.github.com/elijahmanor/9e12c3c9c357e177a9b40a39fd739e12

    • @matteostara
      @matteostara Год назад

      @@ElijahManor That's fantastic thank you so much! I'll give the config ahi between today and tomorrow 💪🏻

  • @denlogv
    @denlogv Год назад +1

    Is there a way to search for symbols that are in the classpath? So, let's say I have a YAML file that defines a pipeline, and the pipeline references a Python class. How would I go to definition/or search for definition in this case (this kind of search is very easy in JetBrains IDEs)?

    • @ElijahManor
      @ElijahManor  Год назад

      If you are within a file that supports LSP (like TypeScript) you can use some of the keymaps to navigate www.lazyvim.org/keymaps#lsp such as:
      gd Goto Definition
      gr References
      gD Goto Declaration
      gI Goto Implementation
      Buf if you are in a YAML file I don't think it would know symbols from another type, so from there I'd try one of the following www.lazyvim.org/keymaps#telescopenvim
      `sS` Goto Symbol (Workspace)
      `sg` Grep (root dir)
      `sw` Word (root dir)

    • @denlogv
      @denlogv Год назад

      @@ElijahManor thank you for your answer! I tried those, but it doesn't work, it says "method workspace/symbol is not supported by any of the servers registered for the current buffer". I also tried attaching pyright (LSP) directly to the buffer with the YAML file, but it doesn't work either, probably because it can't really analyze non-Python files.

  • @IainSimmons
    @IainSimmons Год назад

    Is the eslint plugin for LazyVim new? I swear I couldn't get a config to work with both eslint and prettier since I switched to LazyVim a month or so ago.
    Now I've got all this extra stuff with lsp-zero and it's all too complicated!
    I might try go back to just the built-in LazyVim plugins.

    • @ElijahManor
      @ElijahManor  Год назад

      Yes the plugins for eslint and prettier are relatively new. They did not exist when LazyVim first came out. The discussions tab on the LazyVim repo has some good info about lots of things github.com/LazyVim/LazyVim/discussions and I'm guessing some of these plugins came out of that.

  • @ajmasia
    @ajmasia Год назад

    Hi, amazing video! I'm tesing it and stylua server don;t work, I had to install in in my system manually 🙂 Any idea?
    Thanks!

    • @ElijahManor
      @ElijahManor  Год назад +1

      You know, a while back I had issues with path stuff when installing additional linters/formatters, but that seems to have gone away for me. I'm not sure if it was an upgrade of LazyVim, an upgrade of one of the many plugins, an upgrade of Neovim itself, a possible tweak in my .zshrc file, or something else.
      But, before that I solved the issue a few ways.
      1. You can install a linter/formatter manually and globally (which it sounds like you did)
      2. You can tell null-ls where the linters/formatters are located
      3. Adjust your PATH to include the location where your linters/formatters are being installed
      For #2, you could do something like...
      {
      "jose-elias-alvarez/null-ls.nvim",
      opts = function(_, opts)
      local nls = require("null-ls")
      local mason_bin = vim.fn.stdpath("data") .. "/mason/bin"
      opts.sources = vim.list_extend(opts.sources, {
      nls.builtins.diagnostics.proselint.with({
      command = mason_bin .. "/proselint",
      }),
      })
      end,
      },
      however, since it was already registered by LazyVim it'd be a bit more complicated. You'd need to unregister and re-register stylua, sort of like I did in this gist... gist.github.com/elijahmanor/5d7db1884c40e354406b6eb3d1e12dc4
      For #3, you could do something like...
      I'd double check where mason is installing your stuff. It should be in the following location...
      :lua print(vim.fn.stdpath("data") .. "/mason/bin")
      Then append that to your PATH in your .zshrc (or whatever shell config you use). You can peek and see if you see stylua here...
      ls ~/.local/share/nvim/mason/bin

    • @ajmasia
      @ajmasia Год назад

      Thanks @@ElijahManor for your time! I will test it ;-)

  • @noahzhu7277
    @noahzhu7277 Год назад +1

    How can I use telescope to show the code actions instead of noice? 5:23

    • @ElijahManor
      @ElijahManor  Год назад +1

      Telescope removed code_action in favor of `:lua vim.lsp.buf.code_action()` and `code_action` uses `vim.ui.select` under the hood. LazyVim includes the dressing.nvim plugin github.com/stevearc/dressing.nvim which overrides what vim.ui.select looks like

  • @iceystyle2-cu1ob
    @iceystyle2-cu1ob Год назад

    Can you show us alternative for code runner and error lens how to set up lsp with lazy vim custom shortcut in lsp

    • @ElijahManor
      @ElijahManor  Год назад

      Hm, I'm not sure if I'm following the question here. What is it that you are wanting to change?

  • @mazzu83
    @mazzu83 Год назад +1

    Hello, sorry for this basic question, but why setup eslint and prettier with lsp and with null-ls too? Also, eslint on save corrects some errors but, for example, it doesn't sort imports. Thanks

    • @ElijahManor
      @ElijahManor  Год назад

      The eslint and eslint_d options for null-js are either VERY slow or lacking in features in my experience. So leveraging the ESLint LSP both helps with speed and a richer set of features.
      As for Prettier (prettierd to be exact), it works nicely and quickly with null-ls (as well as many of the other linters/formatters that I've used).

    • @mazzu83
      @mazzu83 Год назад +1

      @@ElijahManor Thanks for reply. So I setup eslint with LSP and prettierd to null-ls? If I setup prettierd in both files (lsp and null-ls) what is happened?

    • @ElijahManor
      @ElijahManor  Год назад

      @@mazzu83 Prettier is not available as a LSP, so not sure exactly what you mean. You'd see prettierd installed with Mason, but that is an executable that is installed and used under the covers by null-ls. Null-ls has the info on how to communicate with pretierd (what you see from Mason). However, I could be misunderstanding what you are asking.

    • @ElijahManor
      @ElijahManor  Год назад

      @@mazzu83 Gotcha. There isn't a double import. Let me try to explain...
      { import = "lazyvim.plugins.extras.formatting.prettier" }, is the only thing you need to do in the lazy.lua file.
      That import has all the mason and lsp stuff inside of that file and does the setup for you. That page in the doc is trying to show you what all is happening under the covers. You can look at the full file here... github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/plugins/extras/formatting/prettier.lua
      In that one import it registers with mason which will install the prettierd runtime (the executable that actually does the formatting) and registers prettierd with null-ls (which knows how to communicate with prettierd and has a bunch of rules like which filetypes to use, etc) github.com/jose-elias-alvarez/null-ls.nvim/blob/main/lua/null-ls/builtins/formatting/prettierd.lua
      I hope that helps clear things up. There is only one import needed and it does all of that stuff for you.

    • @mazzu83
      @mazzu83 Год назад

      @@ElijahManor wow, now I understand how it works. Really really thanks for explaining very well.

  • @AdamDruzd
    @AdamDruzd Год назад +1

    Hi,
    I really like this video, but I have one question.... How to disable prettier just for let say: php files and TypeScript files?

    • @ElijahManor
      @ElijahManor  Год назад +1

      Great question, I tried to answer it (along with other ideas) in this gist gist.github.com/elijahmanor/9e12c3c9c357e177a9b40a39fd739e12

    • @aarond309
      @aarond309 Год назад

      This is a great way to disable it for your entire neovim setup, but if you just need to ignore files in one project, you can also use a `.prettierignore` file

    • @AdamDruzd
      @AdamDruzd Год назад

      @@ElijahManor For me it works perfectly. Thank you very much.

  • @shahidkhan0811
    @shahidkhan0811 Год назад

    How to customize the dashboard in lazyVim??

    • @ElijahManor
      @ElijahManor  Год назад +1

      Great question! You can add a new file to the ~/.config/nvim/lua/plugins folder maybe called alpha.lua and override whatever options you want
      Here are the options that LazyVim is using, but you are welcome to adjust them how you want www.lazyvim.org/plugins/ui#alpha-nvim
      An idea would be to have something like this...
      return {
      "goolord/alpha-nvim",
      opts = function(_, opts)
      local logo = [[
      ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗
      ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║
      ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║
      ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║
      ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║
      ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
      [ @elijahmanor ]
      ]]
      opts.section.header.val = vim.split(logo, "
      ", { trimempty = true })
      end,
      }

  • @MrG0CE
    @MrG0CE Год назад +1

    HI ! HOW CON U FORMAT ON SAVE WITH TABS ??

    • @ElijahManor
      @ElijahManor  Год назад +1

      Great question, I tried to answer it (along with other ideas) in this gist gist.github.com/elijahmanor/9e12c3c9c357e177a9b40a39fd739e12
      An easier answer to your question is to add a prettier config file to the root of your project, but the above gist has some more advanced ideas that could be helpful to you and could also answer the question.

    • @MrG0CE
      @MrG0CE Год назад +1

      @@ElijahManor THANK YOU VERY MUCH ! I'LL TAKE A LOOK :)

    • @ElijahManor
      @ElijahManor  Год назад

      Sure thing, you might use that `npx prettier-init` tool to generate your prettierrc file (unless you want to make your own). Or the other technique I showed should work too (but is more advanced)

  • @AhmadMughal1
    @AhmadMughal1 7 месяцев назад

    how the hell do i comment a single or mutiple lines inside LazyVim i cannot seem to find it how it is done

    • @ElijahManor
      @ElijahManor  7 месяцев назад

      Looks like it was changed to use mini.comment github.com/echasnovski/mini.comment and I wonder if the keymaps section was accidentally moved from the LazyVim keymap docs www.lazyvim.org/keymaps Via the mini.comment docs gcc is the common way to comment, but you can use motions, visual selections with gc etc…

    • @ElijahManor
      @ElijahManor  7 месяцев назад

      Btw, if you press the letter `g` then which-key will come up and you'll see `c` for comment. Pressing the leader key (space) and waiting for which-key is good for finding keymaps and also pressing `g`. Also sk will search for keymaps in telescope. You could type comment there and see `gcc` for example to comment a line

    • @AhmadMughal1
      @AhmadMughal1 7 месяцев назад

      @@ElijahManor Thanks for the comment the sk for searching keymaps is a life saver. One more thing that i am struggling with is trying to remap to perform zz as i want it centered after moving up and down but inside keymaps.lua i tried doing it with vim.keymap.set but could'nt really remap that existing keymap. Any help is appreciated. I am new so the question might be simple but Neovim can be overwhelming for a new experience.

    • @AhmadMughal1
      @AhmadMughal1 7 месяцев назад

      @@ElijahManor i actually found how it was supposed to be done i guess i just had to figure out the syntax a little
      vim.keymap.set("n", "", "zz", { remap = true })
      That did it.

  • @samadkhafi9211
    @samadkhafi9211 Год назад +1

    Can you make a video on AstroNvim? That would be really helpful.

    • @ElijahManor
      @ElijahManor  Год назад +1

      I've not spent much time with AstroNvim, but I do want to dig into it more. I'm a bit on a LazyVim playlist, so I'll prob stay on that for a bit (as well as side things that pop in here and there). But yes, I'd like to focus time on some of the other distros and either have a focused video on them and/or have a compare/contrast video. But as I mentioned, I have a lot of backlog ideas ahead of that.

    • @samadkhafi9211
      @samadkhafi9211 Год назад

      @@ElijahManor That's great. I do enjoy all of your content. I am learning a lot from you. When you get time, a video comparing different neovim distros will be a great help.

  • @allestaireacasio8012
    @allestaireacasio8012 Год назад

    Mine is not working, so sad.

    • @ElijahManor
      @ElijahManor  Год назад +1

      Oh no, what doesn't work about it?

    • @allestaireacasio8012
      @allestaireacasio8012 Год назад

      @@ElijahManor Wow, didnt expect that you will respond hahahaha, actually it is working now, just have to fix the warnings on CheckHealth (helped by my coworker) regarding on Node (should be 18 and above), Python (shoud be on 3 and above), also must set those version as default executable file when running its command, such as when typing node -v should have version 18 and above :)

  • @tunacan4262
    @tunacan4262 9 месяцев назад +1

    Too fast, I cannot check what you input

    • @ElijahManor
      @ElijahManor  9 месяцев назад +1

      Yeah, wasn't in love with the way I was showing keys and don't like the options on macOS... so I ended up writing my own. Hopefully future videos will be easier to decipher what I'm doing (keys I'm pressing).

  • @liesdamnlies3372
    @liesdamnlies3372 16 дней назад

    Welp, I'm thoroughly lost. This video assumes a lot of prior knowledge about the inner workings of lazyvim, it seems. It also assumes you're a JS developer (I'm not). All I wanna do is just get the nix linter working. That's it. That's all. And yet the documentation available is bereft of any sort of clear, "here's how to take the initial setup of lazyvim and enable a linter".
    I think the biggest reason for my confusion is that you didn't actually explain the _why_ of what you were doing. You just said what you were doing, did it, and...well that's it really. That and this video's specificity re JS. A better title would have been "Linting and Formatting JavaScript".

    • @liesdamnlies3372
      @liesdamnlies3372 16 дней назад

      And for anyone else who is similarly baffled and just looking to turn-on linting:
      1. Open the extra plugin list by either hitting x at the main menu or :LazyExtras
      2. Scroll down to the language plugin you want to enable
      3. With your cursor over that plugin, hit x
      Done. Only if your language is not already supported do you have to go spelunking in the configs. (Typescript _is_ available. ESLint _is_ available. Neither require you to touch the config files; just enable them as any other plugin, following the steps above, under :LazyExtras )

  • @WillEhrendreich
    @WillEhrendreich Год назад

    consider your video booped. lol.

    • @ElijahManor
      @ElijahManor  Год назад

      Much appreciated! You are a trooper

    • @WillEhrendreich
      @WillEhrendreich Год назад

      @@ElijahManor I think that technically makes me a booper. Lol.

  • @underlog
    @underlog Год назад

    Thanks!

    • @ElijahManor
      @ElijahManor  Год назад

      Oh boy, thank you for the super thanks! Glad you found value from the video