modules: use real nix expressions for option examples

This commit is contained in:
Gaetan Lepage 2024-06-19 16:20:13 +02:00 committed by Gaétan Lepage
parent 16db91b37a
commit affee53852
2 changed files with 26 additions and 30 deletions

View file

@ -11,28 +11,30 @@ with lib;
type = types.attrsOf helpers.autocmd.autoGroupOption;
default = { };
description = "augroup definitions";
example = ''
autoGroups = {
example = {
my_augroup = {
clear = true;
}
};
'';
};
};
autoCmd = mkOption {
type = types.listOf helpers.autocmd.autoCmdOption;
default = [ ];
description = "autocmd definitions";
example = ''
autoCmd = [
example = [
{
event = [ "BufEnter" "BufWinEnter" ];
pattern = [ "*.c" "*.h" ];
event = [
"BufEnter"
"BufWinEnter"
];
pattern = [
"*.c"
"*.h"
];
command = "echo 'Entering a C or C++ file'";
}
];
'';
};
};

View file

@ -11,33 +11,27 @@ with lib;
type = types.attrsOf helpers.nixvimTypes.highlight;
default = { };
description = "Define new highlight groups";
example = ''
highlight = {
example = {
MacchiatoRed.fg = "#ed8796";
};
'';
};
highlightOverride = mkOption {
type = types.attrsOf helpers.nixvimTypes.highlight;
default = { };
description = "Define highlight groups to override existing highlight";
example = ''
highlightOverride = {
example = {
Comment.fg = "#ff0000";
};
'';
};
match = mkOption {
type = types.attrsOf types.str;
default = { };
description = "Define match groups";
example = ''
match = {
example = {
ExtraWhitespace = "\\s\\+$";
};
'';
};
};