34 lines
631 B
Nix
34 lines
631 B
Nix
{ vim, ... }:
|
|
|
|
{ configs ? {
|
|
neoformat_enabled_markdown = [ "denofmt" ];
|
|
neoformat_rust_rustfmt = {
|
|
exe = "rustfmt";
|
|
args = [ "--edition 2021" ];
|
|
stdin = 1;
|
|
};
|
|
}
|
|
}:
|
|
|
|
let inherit (builtins) concatLists attrValues mapAttrs; in
|
|
let
|
|
baseConfigs = {
|
|
neoformat_try_node_exe = 1;
|
|
neoformat_only_msg_on_error = 1;
|
|
};
|
|
in
|
|
|
|
{
|
|
neoformat = concatLists [
|
|
(attrValues (mapAttrs vim.g (baseConfigs // configs)))
|
|
|
|
[
|
|
(vim.cmd' ''
|
|
aug fmt
|
|
au!
|
|
au BufWritePre * try | undojoin | Neoformat | catch /E790/ | Neoformat | endtry
|
|
aug END
|
|
'')
|
|
]
|
|
];
|
|
}
|