2.home-manager/tests/modules/programs/zsh/syntax-highlighting.nix
Austin Horstman d0cdb4101f zsh: fix highlighter backwards compatibility
Use the module system to set the default at user prio so that existing
configs don't clear out `main`

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-01-26 09:42:11 -06:00

24 lines
655 B
Nix

{ pkgs, ... }:
{
programs.zsh = {
enable = true;
syntaxHighlighting = {
enable = true;
package = pkgs.hello;
highlighters = [
"brackets"
"pattern"
"cursor"
];
styles.comment = "fg=#6c6c6c";
patterns."rm -rf *" = "fg=white,bold,bg=red";
};
};
nmt.script = ''
assertFileContains home-files/.zshrc "source ${pkgs.hello}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
assertFileContains home-files/.zshrc "ZSH_HIGHLIGHT_HIGHLIGHTERS=(brackets pattern cursor main)"
assertFileContains home-files/.zshrc "ZSH_HIGHLIGHT_STYLES[comment]='fg=#6c6c6c'"
'';
}