2023-02-20 11:42:13 +01:00
|
|
|
{
|
|
|
|
lib,
|
2024-02-09 14:21:22 +01:00
|
|
|
config,
|
|
|
|
helpers,
|
2023-02-20 11:42:13 +01:00
|
|
|
pkgs,
|
|
|
|
...
|
2024-02-09 14:21:22 +01:00
|
|
|
}:
|
|
|
|
with lib;
|
|
|
|
with helpers.vim-plugin;
|
2024-05-05 19:39:35 +02:00
|
|
|
mkVimPlugin config {
|
|
|
|
name = "zig";
|
|
|
|
originalName = "zig.vim";
|
|
|
|
defaultPackage = pkgs.vimPlugins.zig-vim;
|
|
|
|
globalPrefix = "zig_";
|
2024-03-02 23:41:38 +01:00
|
|
|
|
2024-05-05 19:39:35 +02:00
|
|
|
maintainers = [ maintainers.GaetanLepage ];
|
2024-03-04 09:35:28 +01:00
|
|
|
|
2024-05-05 19:39:35 +02:00
|
|
|
# TODO introduced 2024-03-02: remove 2024-05-02
|
|
|
|
deprecateExtraConfig = true;
|
|
|
|
imports = [
|
|
|
|
(mkRenamedOptionModule
|
|
|
|
[
|
|
|
|
"plugins"
|
|
|
|
"zig"
|
|
|
|
"formatOnSave"
|
|
|
|
]
|
|
|
|
[
|
|
|
|
"plugins"
|
|
|
|
"zig"
|
|
|
|
"settings"
|
|
|
|
"fmt_autosave"
|
|
|
|
]
|
|
|
|
)
|
|
|
|
];
|
2024-03-02 23:41:38 +01:00
|
|
|
|
2024-05-05 19:39:35 +02:00
|
|
|
settingsOptions = {
|
|
|
|
fmt_autosave = helpers.defaultNullOpts.mkBool true ''
|
|
|
|
This plugin enables automatic code formatting on save by default using zig fmt.
|
|
|
|
To disable it, you can set this option to `false`.
|
|
|
|
'';
|
|
|
|
};
|
2021-03-31 13:56:18 +01:00
|
|
|
|
2024-05-05 19:39:35 +02:00
|
|
|
settingsExample = {
|
|
|
|
fmt_autosave = false;
|
|
|
|
};
|
|
|
|
}
|