mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-17 16:01:36 +02:00
Merge branch 'main' into lib
This commit is contained in:
commit
8748b953c3
58 changed files with 2871 additions and 419 deletions
|
@ -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
|
||||
-- }}
|
||||
'');
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue