Closed barrett-ruth closed 2 months ago
I believe it should be possible to do this with the condition
key:
null_ls.builtins.formatting.cbfmt.with({
-- cbfmt requires a config file
condition = function(utils)
return utils.root_has_file(".cbfmt.toml")
end,
})
Maybe I should add it to cbfmt's docs.
Yes, my question was about where that should be the default - included in the generator
This should work - please test it. :)
Brilliant works perfectly @mochaaP thanks for catching treefmt or whatever the other one as well. Feel free to merge and close
Issues
Feature description
Some formatters (i.e. cbfmt):
Currently,
cbfmt
will attach to every markdown/org buffer. In this case I believe it makes sense to conditionally attach if.cbfmt.toml
for example, exists.However, I understand that [runtime_]condition have overhead- even though it'll just be checking for a single file.
That or, I can just write a PR to
BUILTINS.md
including the condition function beneath cbfmt. That may be the simpler solution.Help
Yes
Implementation help
No response