diff --git a/modules/plugins/style/neoformat.nix b/modules/plugins/style/neoformat.nix index f601d65..f41a08d 100644 --- a/modules/plugins/style/neoformat.nix +++ b/modules/plugins/style/neoformat.nix @@ -23,7 +23,13 @@ let cfg = config.plugins.style.neoformat; in }; }; - autoformat.enable = mkEnableOption "Autoformat on save file"; + autoformat = { + enable = mkEnableOption "Autoformat on save file"; + pattern = { + type = either str commas; + default = "*"; + }; + }; }; config = lib.mkIf cfg.enable { @@ -39,7 +45,7 @@ let cfg = config.plugins.style.neoformat; in autoformat = '' augroup autoformat autocmd! - autocmd BufWritePre * try | undojoin | Neoformat | catch /E790/ | Neoformat | endtry + autocmd BufWritePre ${cfg.autoformat.pattern} try | undojoin | Neoformat | catch /E790/ | Neoformat | endtry augroup END '';