Skip to content

Commit

Permalink
Merge pull request NixOS#15 from bkase/zsh-syntax-highlighting
Browse files Browse the repository at this point in the history
Added zsh-syntax-highlighting option to zsh program
  • Loading branch information
LnL7 authored Mar 5, 2017
2 parents d92f0e8 + d0e9c07 commit 395ee13
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion modules/programs/zsh/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,21 @@ in
description = "Enable fzf keybinding for Ctrl-r history search.";
};

programs.zsh.enableSyntaxHighlighting = mkOption {
type = types.bool;
default = false;
description = "Enable zsh-syntax-highlighting.";
};

};

config = mkIf cfg.enable {

environment.systemPackages =
[ # Include zsh package
pkgs.zsh
] ++ optional cfg.enableCompletion pkgs.nix-zsh-completions;
] ++ optional cfg.enableCompletion pkgs.nix-zsh-completions
++ optional cfg.enableSyntaxHighlighting pkgs.zsh-syntax-highlighting;

environment.loginShell = mkDefault "${shell}/bin/zsh -l";
environment.variables.SHELL = mkDefault "${shell}/bin/zsh";
Expand Down Expand Up @@ -185,6 +192,11 @@ in
${optionalString cfg.enableCompletion "autoload -U compinit && compinit"}
${optionalString cfg.enableBashCompletion "autoload -U bashcompinit && bashcompinit"}
${optionalString cfg.enableSyntaxHighlighting
"source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
}
# Read system-wide modifications.
if test -f /etc/zshrc.local; then
. /etc/zshrc.local
Expand Down

0 comments on commit 395ee13

Please sign in to comment.