2.home-manager/tests/modules/programs/zsh/syntax-highlighting.nix
name.tar.xz c37679d37b
zsh: Set highlighters instead of appending to allow disabling main
This allows users to drop the main highlighter (or highlighters set by plugins sourced before eg: catppucin's zsh highlighting settings)
2026-01-25 21:12:10 -06:00

25 lines
670 B
Nix

{ pkgs, ... }:
{
programs.zsh = {
enable = true;
syntaxHighlighting = {
enable = true;
package = pkgs.hello;
highlighters = [
"main"
"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=(main brackets pattern cursor)"
assertFileContains home-files/.zshrc "ZSH_HIGHLIGHT_STYLES[comment]='fg=#6c6c6c'"
'';
}