Merge branch 'main' into lib

This commit is contained in:
Pedro Alves 2023-01-24 01:27:39 +00:00
commit 8748b953c3
58 changed files with 2871 additions and 419 deletions

View file

@ -15,10 +15,21 @@ with lib;
};
'';
};
match = mkOption {
type = types.attrsOf types.str;
default = { };
description = "Define match groups";
example = ''
match = {
ExtraWhitespace = '\\s\\+$';
};
'';
};
};
config = mkIf (config.highlight != { }) {
extraConfigLuaPost = ''
config = mkIf (config.highlight != { } || config.match != { }) {
extraConfigLuaPost = (optionalString (config.highlight != { }) ''
-- Highlight groups {{
do
local highlights = ${helpers.toLuaObject config.highlight}
@ -28,6 +39,18 @@ with lib;
end
end
-- }}
'';
'') +
(optionalString (config.match != { }) ''
-- Match groups {{
do
local match = ${helpers.toLuaObject config.match}
for k,v in pairs(match) do
vim.fn.matchadd(k, v)
end
end
-- }}
'');
};
}