mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-30 19:54:43 +00:00
Added zsh-syntax-highlighting option to zsh program
This commit is contained in:
parent
258cda10ce
commit
d0e9c0762a
1 changed files with 13 additions and 1 deletions
|
@ -101,6 +101,12 @@ in
|
||||||
description = "Enable fzf keybinding for Ctrl-r history search.";
|
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 {
|
config = mkIf cfg.enable {
|
||||||
|
@ -108,7 +114,8 @@ in
|
||||||
environment.systemPackages =
|
environment.systemPackages =
|
||||||
[ # Include zsh package
|
[ # Include zsh package
|
||||||
pkgs.zsh
|
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.loginShell = mkDefault "${shell}/bin/zsh -l";
|
||||||
environment.variables.SHELL = mkDefault "${shell}/bin/zsh";
|
environment.variables.SHELL = mkDefault "${shell}/bin/zsh";
|
||||||
|
@ -185,6 +192,11 @@ in
|
||||||
${optionalString cfg.enableCompletion "autoload -U compinit && compinit"}
|
${optionalString cfg.enableCompletion "autoload -U compinit && compinit"}
|
||||||
${optionalString cfg.enableBashCompletion "autoload -U bashcompinit && bashcompinit"}
|
${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.
|
# Read system-wide modifications.
|
||||||
if test -f /etc/zshrc.local; then
|
if test -f /etc/zshrc.local; then
|
||||||
. /etc/zshrc.local
|
. /etc/zshrc.local
|
||||||
|
|
Loading…
Add table
Reference in a new issue