From a17bc3217f0d0a622f2818b2f3ea997f06cd00a4 Mon Sep 17 00:00:00 2001 From: DG Date: Mon, 28 Jun 2021 02:04:38 -0400 Subject: [PATCH] zsh: add `enableSyntaxHighlighting` option (#2144) 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 896e4fe83..5f6f7b89f 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}