mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
zsh.syntaxHighlighting: add option to customize styles
This commit is contained in:
parent
fe92e5fb93
commit
420b83b29b
1 changed files with 22 additions and 0 deletions
|
@ -48,6 +48,23 @@ in
|
||||||
https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/pattern.md
|
https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/pattern.md
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
styles = mkOption {
|
||||||
|
default = {};
|
||||||
|
type = types.attrsOf types.string;
|
||||||
|
|
||||||
|
example = literalExample ''
|
||||||
|
{
|
||||||
|
"alias" = "fg=magenta,bold";
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
|
description = ''
|
||||||
|
Specifies custom styles to be highlighted by zsh-syntax-highlighting.
|
||||||
|
|
||||||
|
Please refer to the docs for more information about the usage:
|
||||||
|
https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/main.md
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -73,6 +90,11 @@ in
|
||||||
pattern: design:
|
pattern: design:
|
||||||
"ZSH_HIGHLIGHT_PATTERNS+=('${pattern}' '${design}')"
|
"ZSH_HIGHLIGHT_PATTERNS+=('${pattern}' '${design}')"
|
||||||
) cfg.patterns)
|
) cfg.patterns)
|
||||||
|
++ optionals (length(attrNames cfg.styles) > 0)
|
||||||
|
(mapAttrsToList (
|
||||||
|
styles: design:
|
||||||
|
"ZSH_HIGHLIGHT_STYLES[${styles}]='${design}'"
|
||||||
|
) cfg.styles)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue