-
-
Notifications
You must be signed in to change notification settings - Fork 191
Description
β οΈ Please verify that this feature request has NOT been suggested before.
- I checked and didn't find a similar feature request
π·οΈ Feature Type
API Additions
π Feature description
A lot of formatters come with options and configuration, but NVF does not support configuring any of them.
βοΈ Solution
A simple vim.languages.<lang>.format.command would suffice, as it's standard practice for formatters to support configuration either through CLI arguments or by passing a configuration file.
This option would override vim.languages.<lang>.format.{package, type} as you would effectively need to specify a path in the nix store to the formatter.
Usage example:
{ pkgs, lib, ...}: {
vim.languages.nix.format.command =
"${lib.getExe pkgs.alejandra} --experimental-config ${./alejandra.toml}";
}β Alternatives
A lot of formatters read configuration files automatically relative to their execution directory, but I'd like to set defaults for all files of a specific language.
π Additional Context
#382 will completely change how language configuration works, so I'd like to take a shot at implementing this myself with a bit of guidance if given the go-ahead, to prevent needlessly increasing your workload.