Nvim : Add a base for custom hl config.

This commit is contained in:
Dmitry Voronin 2024-10-09 04:39:07 +03:00
parent f9aedf962e
commit 8db6f1ad05
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
3 changed files with 20 additions and 1 deletions

View file

@ -45,6 +45,7 @@ in {
./module/config/Etc.nix ./module/config/Etc.nix
./module/config/Search.nix ./module/config/Search.nix
./module/config/Tab.nix ./module/config/Tab.nix
./module/config/Highlight.nix
./module/plugin/Filetree.nix ./module/plugin/Filetree.nix
./module/plugin/Gruvbox.nix ./module/plugin/Gruvbox.nix
./module/plugin/Bufferline.nix ./module/plugin/Bufferline.nix

View file

@ -0,0 +1,16 @@
{ config, ... }: let
cfg = config.style.color;
bg = cfg.bg.regular;
in {
# TODO: Create a function to set group color.
text = ''
vim.api.nvim_create_autocmd({"ColorScheme", "VimEnter"}, {
group = vim.api.nvim_create_augroup('Color', {}),
pattern = "*",
callback = function ()
vim.api.nvim_set_hl(0, "CursorLine", { bg = "#${bg}" })
end
})
'';
}

View file

@ -17,7 +17,9 @@
'NormalFloat', 'NormalFloat',
}, },
-- table: groups you don't want to clear -- table: groups you don't want to clear
exclude_groups = {}, exclude_groups = {
'CursorLine',
},
-- function: code to be executed after highlight groups are cleared -- function: code to be executed after highlight groups are cleared
-- Also the user event "TransparentClear" will be triggered -- Also the user event "TransparentClear" will be triggered
on_clear = function() end, on_clear = function() end,