From 6fb5502aa2f8969cd01bb733ccde674c8f427248 Mon Sep 17 00:00:00 2001 From: Dave Gallant Date: Sat, 26 Jun 2021 20:23:13 -0400 Subject: [PATCH] zsh: add `enableSyntaxHighlighting` option Add a simple way to enable syntax highlighting for zsh using https://github.com/zsh-users/zsh-syntax-highlighting --- modules/programs/zsh.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index 896e4fe83fa9..5f6f7b89f412 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -290,6 +290,11 @@ in description = "Enable zsh autosuggestions"; }; + enableSyntaxHighlighting = mkOption { + default = false; + description = "Enable zsh syntax highlighting"; + }; + history = mkOption { type = historyModule; default = {}; @@ -482,6 +487,10 @@ in "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 . "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh" ${envVarsStr}