.lazy.lua, the hidden gem of project specific configuration
- neovim
- lazyvim
After being stuck with the global configuration for a while, I found a hidden gem in the lazyvim plugin
called .lazy.lua
uwhich allows me to override specific plugins for specific projects.
To make the magic happen, you need to create a .lazy.lua
file in the root of your project and add the custom configuration to it.
For exapmle, I have a global conform
configuration for javascript, typescript and json using eslint
and prettier
. However, for a specific project, I want to use biome
instead. Then I add the following configuration to the.lazy.lua
file:
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
javascript = { "biome" },
typescript = { "biome" },
json = { "biome"}
}
}
}
This approach is very useful and it is a true hidden gem of the lazyvim plugin. Thank you for this blog that shows me how to use it.