This repository has been archived on 2024-05-02. You can view files and clone it, but cannot push or open issues or pull requests.
home-manager-flake/modules/shell/zsh/default.nix

46 lines
1.1 KiB
Nix

{ config, lib, ... }: lib.mkIf config.programs.zsh.enable {
programs = {
zsh = {
defaultKeymap = "emacs";
dotDir = ".config/zsh";
shellAliases = {
j = "z";
ji = "zi";
};
initExtra = builtins.readFile ../../configs/zsh/zshrc.zsh;
completionInit = ''
autoload -U compinit bashcompinit
compinit
bashcompinit'';
history = {
path = "${config.xdg.cacheHome}/zsh_history";
save = 100000;
size = 100000;
share = true;
extended = true;
};
historySubstringSearch = {
enable = true;
searchDownKey = [
"^[[B"
];
searchUpKey = [
"^[[A"
];
};
zplug = {
enable = true;
plugins = [
{ name = "zsh-users/zsh-completions"; }
{ name = "zdharma-continuum/fast-syntax-highlighting"; }
{ name = "zsh-users/zsh-autosuggestions"; }
{ name = "nix-community/nix-zsh-completions"; }
];
};
envExtra = ''
export DIRENV_LOG_FORMAT=$'\033[2mdirenv: %s\033[0m'
'';
};
};
}