Skip to content

Commit

Permalink
plugins/zig: switch to settings option
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage committed Mar 3, 2024
1 parent f3cfd84 commit 60c6912
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions plugins/languages/zig.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,25 @@ with helpers.vim-plugin;
originalName = "zig.vim";
defaultPackage = pkgs.vimPlugins.zig-vim;
globalPrefix = "zig_";

# TODO introduced 2024-03-02: remove 2024-05-02
deprecateExtraConfig = true;
imports = [
(
mkRenamedOptionModule
["plugins" "zig" "formatOnSave"]
["plugins" "zig" "settings" "fmt_autosave"]
)
];

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`.
'';
};

# Possibly add option to disable Treesitter highlighting if this is installed
options = {
formatOnSave = mkDefaultOpt {
type = types.bool;
global = "fmt_autosave";
description = "Run zig fmt on save";
};
settingsExample = {
fmt_autosave = false;
};
}

0 comments on commit 60c6912

Please sign in to comment.