diff options
| author | Michael Hoang <Enzime@users.noreply.github.com> | 2024-11-06 07:31:39 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-06 07:31:39 +0000 |
| commit | 98e7dba87238e4fa4eac609dc44f07dab40661c4 (patch) | |
| tree | c1eec0ed215e06e71aad773a5333fca028906dbf /modules/programs | |
| parent | 0e3f3f017c14467085f15d42343a3aaaacd89bcb (diff) | |
| parent | 48e5c8de1a4575441b46cb174afebfa02732c0ff (diff) | |
Merge pull request #909 from motheki/fast-syntax-highlighting-support
Add support for zsh-fast-syntax-highlighting
Diffstat (limited to 'modules/programs')
| -rw-r--r-- | modules/programs/zsh/default.nix | 15 |
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}"} |
