mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
plugins/mini-icons: init
This commit is contained in:
parent
2c0a9ff1e2
commit
69ee7b8fb9
2 changed files with 68 additions and 0 deletions
42
plugins/by-name/mini-icons/default.nix
Normal file
42
plugins/by-name/mini-icons/default.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{ lib, ... }:
|
||||
lib.nixvim.plugins.mkNeovimPlugin {
|
||||
name = "mini-icons";
|
||||
moduleName = "mini.icons";
|
||||
packPathName = "mini.icons";
|
||||
configLocation = lib.mkOrder 800 "extraConfigLua";
|
||||
|
||||
maintainers = [ lib.maintainers.HeitorAugustoLN ];
|
||||
|
||||
settingsExample = {
|
||||
style = "glyph";
|
||||
extension = {
|
||||
lua = {
|
||||
hl = "Special";
|
||||
};
|
||||
};
|
||||
file = {
|
||||
"init.lua" = {
|
||||
glyph = "";
|
||||
hl = "MiniIconsGreen";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraOptions = {
|
||||
mockDevIcons = lib.mkEnableOption "" // {
|
||||
description = ''
|
||||
Whether to tell `mini.icons` to emulate `nvim-web-devicons` for plugins that don't natively support it.
|
||||
|
||||
When enabled, you don't need to set `plugins.web-devicons.enable`. This will replace the need for it.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
plugins.mini-icons.luaConfig.content = lib.mkAfter (
|
||||
lib.optionalString cfg.mockDevIcons ''
|
||||
MiniIcons.mock_nvim_web_devicons()
|
||||
''
|
||||
);
|
||||
};
|
||||
}
|
26
tests/test-sources/plugins/by-name/mini-icons/default.nix
Normal file
26
tests/test-sources/plugins/by-name/mini-icons/default.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
empty = {
|
||||
plugins.mini-icons.enable = true;
|
||||
};
|
||||
|
||||
example = {
|
||||
plugins.mini-icons = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
style = "glyph";
|
||||
extension = {
|
||||
lua = {
|
||||
hl = "Special";
|
||||
};
|
||||
};
|
||||
file = {
|
||||
"init.lua" = {
|
||||
glyph = "";
|
||||
hl = "MiniIconsGreen";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue