mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-18 16:29:07 +02:00
modules/highlights: added a wrapper around vim.fn.matchadd
This commit is contained in:
parent
b9a4f0ca19
commit
82fa648e04
1 changed files with 21 additions and 0 deletions
|
@ -15,6 +15,17 @@ with lib;
|
|||
};
|
||||
'';
|
||||
};
|
||||
|
||||
match = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = { };
|
||||
description = "Define match groups";
|
||||
example = ''
|
||||
match = {
|
||||
ExtraWhitespace = '\\s\\+$';
|
||||
};
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (config.highlight != { }) {
|
||||
|
@ -28,6 +39,16 @@ with lib;
|
|||
end
|
||||
end
|
||||
-- }}
|
||||
|
||||
-- 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