mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
30 lines
610 B
Nix
30 lines
610 B
Nix
{ config, lib, helpers, ... }:
|
|
with lib;
|
|
{
|
|
options = {
|
|
highlight = mkOption {
|
|
type = types.attrsOf types.anything;
|
|
default = { };
|
|
description = "Define highlight groups";
|
|
example = ''
|
|
highlight = {
|
|
Comment.fg = '#ff0000';
|
|
};
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = mkIf (config.highlight != { }) {
|
|
extraConfigLuaPost = ''
|
|
-- Highlight groups {{
|
|
do
|
|
local highlights = ${helpers.toLuaObject config.highlight}
|
|
|
|
for k,v in pairs(highlights) do
|
|
vim.api.nvim_set_hl(0, k, v)
|
|
end
|
|
end
|
|
-- }}
|
|
'';
|
|
};
|
|
}
|