caenix/modules/home/caem/core/zsh.nix
2025-01-24 03:16:15 +01:00

62 lines
1.3 KiB
Nix

{ pkgs, config, ... }:
{
home.packages = with pkgs; [
lsd
bat
fd
ripgrep
fzf
tmux
fastfetch
tre
];
programs.bat = {
enable = true;
config = {
theme = "ansi";
};
};
home.file.".zshenv".enable = false;
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
dotDir = ".config/zsh";
autocd = true;
history.size = 10000;
history.ignoreAllDups = true;
/* Not persisted on purpose */
history.path = "${config.xdg.cacheHome}/zsh_history";
shellAliases = {
cat = "bat --paging=never";
ls = "lsd";
ll = "lsd -lah";
tree = "tre";
};
initExtra = ''
alias -g -- -h='-h 2>&1 | bat --language=help --style=plain'
alias -g -- --help='--help 2>&1 | bat --language=help --style=plain'
export MANPAGER="sh -c 'sed -u -e \"s/\\x1B\[[0-9;]*m//g; s/.\\x08//g\" | bat -p -lman'"
'';
plugins = [
{
name = "zsh-nix-shell";
file = "nix-shell.plugin.zsh";
src = pkgs.fetchFromGitHub {
owner = "chisui";
repo = "zsh-nix-shell";
rev = "v0.8.0";
sha256 = "1lzrn0n4fxfcgg65v0qhnj7wnybybqzs4adz7xsrkgmcsr0ii8b7";
};
}
];
};
}