1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-01 00:39:45 +01:00

zsh: add enableSyntaxHighlighting option (#2144)

Add a simple way to enable syntax highlighting for zsh using https://github.com/zsh-users/zsh-syntax-highlighting
This commit is contained in:
DG 2021-06-28 02:04:38 -04:00 committed by GitHub
parent 2aeaf65e8f
commit a17bc3217f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -290,6 +290,11 @@ in
description = "Enable zsh autosuggestions"; description = "Enable zsh autosuggestions";
}; };
enableSyntaxHighlighting = mkOption {
default = false;
description = "Enable zsh syntax highlighting";
};
history = mkOption { history = mkOption {
type = historyModule; type = historyModule;
default = {}; default = {};
@ -482,6 +487,10 @@ in
"source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh" "source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh"
} }
${optionalString cfg.enableSyntaxHighlighting
"source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
}
# Environment variables # Environment variables
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh" . "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
${envVarsStr} ${envVarsStr}