Project specific configurations in LazyVim with .lazy.lua

Did you know LazyVim could do this?

So, I stumbled upon this nifty trick for LazyVim that lets me set project-specific configurations without turning my global settings into a disaster like the rest of my life currently. Apparently, all you have to do is drop a .lazy.lua file into my project's root directory.

A lazy.lua file for every dir?

In this magical .lazy.lua file, you can tweak settings like tabstop, shiftwidth, and even disable auto-formatting—perfect for telling everyone on the internet that I .... disabled auto-formatting?

You can configure plugins and more!

But wait, there's more! You can also configure plugins on a per-project basis. By returning a table with the plugin's configuration, You can specify different formatters for different file types within the project. This ensures that each project gets its own special treatment without interfering with a global setup.

You can even set file-type-specific configurations within the .lazy.lua. By creating an autocommand for a particular file type, settings can be adjusted like tabstop and shiftwidth or enable auto-formatting just for those files. This is especially handy for projects that insist on their own quirky indentation styles.

This approach keeps dotfiles clean and my sanity intact. Pretty cool little neovim thing that I didn't even know about! Check it the article below!