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; type = types.attrsOf helpers.autocmd.autoGroupOption;
default = { }; default = { };
description = "augroup definitions"; description = "augroup definitions";
example = '' example = {
autoGroups = {
my_augroup = { my_augroup = {
clear = true; clear = true;
}
}; };
''; };
}; };
autoCmd = mkOption { autoCmd = mkOption {
type = types.listOf helpers.autocmd.autoCmdOption; type = types.listOf helpers.autocmd.autoCmdOption;
default = [ ]; default = [ ];
description = "autocmd definitions"; description = "autocmd definitions";
example = '' example = [
autoCmd = [
{ {
event = [ "BufEnter" "BufWinEnter" ]; event = [
pattern = [ "*.c" "*.h" ]; "BufEnter"
"BufWinEnter"
];
pattern = [
"*.c"
"*.h"
];
command = "echo 'Entering a C or C++ file'"; command = "echo 'Entering a C or C++ file'";
} }
]; ];
'';
}; };
}; };

View file

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