summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMichael Hoang <Enzime@users.noreply.github.com>2024-11-06 07:31:39 +0000
committerGitHub <noreply@github.com>2024-11-06 07:31:39 +0000
commit98e7dba87238e4fa4eac609dc44f07dab40661c4 (patch)
treec1eec0ed215e06e71aad773a5333fca028906dbf /modules
parent0e3f3f017c14467085f15d42343a3aaaacd89bcb (diff)
parent48e5c8de1a4575441b46cb174afebfa02732c0ff (diff)
Merge pull request #909 from motheki/fast-syntax-highlighting-support
Add support for zsh-fast-syntax-highlighting
Diffstat (limited to 'modules')
-rw-r--r--modules/programs/zsh/default.nix15
1 files changed, 14 insertions, 1 deletions
diff --git a/modules/programs/zsh/default.nix b/modules/programs/zsh/default.nix
index 1665fcd..a9ffbd8 100644
--- a/modules/programs/zsh/default.nix
+++ b/modules/programs/zsh/default.nix
@@ -107,15 +107,24 @@ in
default = false;
description = "Enable zsh-syntax-highlighting.";
};
+
+ programs.zsh.enableFastSyntaxHighlighting = mkEnableOption "zsh-fast-syntax-highlighting";
};
config = mkIf cfg.enable {
+ assertions = [
+ {
+ assertion = !(cfg.enableSyntaxHighlighting && cfg.enableFastSyntaxHighlighting);
+ message = "zsh-syntax-highlighting and zsh-fast-syntax-highlighting are mutually exclusive, please disable one of them.";
+ }
+ ];
environment.systemPackages =
[ # Include zsh package
pkgs.zsh
] ++ optional cfg.enableCompletion pkgs.nix-zsh-completions
- ++ optional cfg.enableSyntaxHighlighting pkgs.zsh-syntax-highlighting;
+ ++ optional cfg.enableSyntaxHighlighting pkgs.zsh-syntax-highlighting
+ ++ optional cfg.enableFastSyntaxHighlighting pkgs.zsh-fast-syntax-highlighting;
environment.pathsToLink = [ "/share/zsh" ];
@@ -192,6 +201,10 @@ in
"source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
}
+ ${optionalString cfg.enableFastSyntaxHighlighting
+ "source ${pkgs.zsh-fast-syntax-highlighting}/share/zsh-fast-syntax-highlighting/zsh-fast-syntax-highlighting.zsh"
+ }
+
${optionalString cfg.enableFzfCompletion "source ${fzfCompletion}"}
${optionalString cfg.enableFzfGit "source ${fzfGit}"}
${optionalString cfg.enableFzfHistory "source ${fzfHistory}"}