zaneyos/config/home/zsh.nix

61 lines
2.0 KiB
Nix
Raw Normal View History

2024-02-09 05:32:21 +01:00
{ config, lib, pkgs, ... }:
2024-02-09 03:51:04 +01:00
2024-02-17 20:13:50 +01:00
let inherit (import ../../options.nix) flakeDir theShell hostname; in
2024-02-09 03:51:04 +01:00
lib.mkIf (theShell == "zsh") {
programs.zsh = {
enable = true;
syntaxHighlighting.enable = true;
2024-02-09 05:32:21 +01:00
enableAutosuggestions = true;
historySubstringSearch.enable = true;
2024-02-09 03:51:04 +01:00
profileExtra = ''
#if [ -z "$DISPLAY" ] && [ "$XDG_VNTR" = 1 ]; then
# exec Hyprland
#fi
'';
initExtra = ''
zstyle ":completion:*" menu select
zstyle ":completion:*" matcher-list "" "m:{a-z0A-Z}={A-Za-z}" "r:|=*" "l:|=* r:|=*"
if type nproc &>/dev/null; then
export MAKEFLAGS="$MAKEFLAGS -j$(($(nproc)-1))"
fi
bindkey '^[[3~' delete-char # Key Del
bindkey '^[[5~' beginning-of-buffer-or-history # Key Page Up
bindkey '^[[6~' end-of-buffer-or-history # Key Page Down
bindkey '^[[1;3D' backward-word # Key Alt + Left
bindkey '^[[1;3C' forward-word # Key Alt + Right
bindkey '^[[H' beginning-of-line # Key Home
bindkey '^[[F' end-of-line # Key End
neofetch
if [ -f $HOME/.zshrc-personal ]; then
source $HOME/.zshrc-personal
fi
eval "$(starship init zsh)"
'';
initExtraFirst = ''
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt autocd nomatch
unsetopt beep extendedglob notify
autoload -Uz compinit
compinit
'';
sessionVariables = {
};
shellAliases = {
sv="sudo vim";
2024-02-17 20:13:50 +01:00
flake-rebuild="nh os switch --nom --hostname ${hostname}";
flake-update="nh os switch --nom --hostname ${hostname} --update";
2024-02-09 03:51:04 +01:00
gcCleanup="nix-collect-garbage --delete-old && sudo nix-collect-garbage -d && sudo /run/current-system/bin/switch-to-configuration boot";
v="nvim";
ls="lsd";
ll="lsd -l";
la="lsd -a";
lal="lsd -al";
".."="cd ..";
2024-02-18 02:17:13 +01:00
neofetch="neofetch --ascii ~/.config/ascii-neofetch";
2024-02-09 03:51:04 +01:00
};
};
}