From 60c69121260cca724e511725f8e1234b9c32be41 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 2 Mar 2024 23:41:38 +0100 Subject: [PATCH] plugins/zig: switch to settings option --- plugins/languages/zig.nix | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/plugins/languages/zig.nix b/plugins/languages/zig.nix index 8e3f873121..36e3895dab 100644 --- a/plugins/languages/zig.nix +++ b/plugins/languages/zig.nix @@ -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; }; }