mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-02-20 15:18:05 +00:00
Added zsh config
This commit is contained in:
148
dot_zshrc
Normal file
148
dot_zshrc
Normal file
@@ -0,0 +1,148 @@
|
||||
# --- Environment Variables ---
|
||||
export EDITOR=nvim
|
||||
export GIT_EDITOR=nvim
|
||||
export PIPENV_VERBOSITY=-1
|
||||
export MAKEFLAGS="-j$(($(nproc) + 1))"
|
||||
export JULIA_NUM_THREADS="$(nproc)"
|
||||
export YAOURT_COLORS="nb=1:pkg=1:ver=1;32:lver=1;45:installed=1;42:grp=1;34:od=1;41;5:votes=1;44:dsc=0:other=1;35"
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export PASSWORD_STORE_DIR="$HOME/.cache/password-store"
|
||||
export GLAMOUR_STYLE="$XDG_CONFIG_HOME/glamour/tokyo_night.json"
|
||||
|
||||
if [[ "$(uname)" != "Windows_NT" ]]; then
|
||||
export GPG_TTY=$(tty)
|
||||
fi
|
||||
|
||||
# Manpage/Less Colors
|
||||
export LESS_TERMCAP_mb=$'\e[01;31m'
|
||||
export LESS_TERMCAP_md=$'\e[01;31m'
|
||||
export LESS_TERMCAP_me=$'\e[0m'
|
||||
export LESS_TERMCAP_so=$'\e[01;44;36m'
|
||||
export LESS_TERMCAP_se=$'\e[0m'
|
||||
export LESS_TERMCAP_us=$'\e[00;36m'
|
||||
export LESS_TERMCAP_ue=$'\e[0m'
|
||||
|
||||
# --- Path Configuration ---
|
||||
typeset -U path
|
||||
path=(
|
||||
/opt/miniconda3/bin
|
||||
/nix/var/nix/profiles/default/bin
|
||||
$HOME/.nix-profile/bin
|
||||
$HOME/.ghcup/bin
|
||||
$HOME/.poetry/bin
|
||||
$HOME/.cargo/bin
|
||||
$HOME/.local/bin
|
||||
$path
|
||||
)
|
||||
export PATH
|
||||
|
||||
# --- Zsh Settings ---
|
||||
HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh_history"
|
||||
HISTSIZE=1000
|
||||
SAVEHIST=2000
|
||||
setopt HIST_IGNORE_DUPS
|
||||
setopt HIST_FIND_NO_DUPS
|
||||
setopt APPEND_HISTORY
|
||||
|
||||
# Vi Mode
|
||||
bindkey -v
|
||||
|
||||
# Initialize Completion System
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
|
||||
# --- Aliases ---
|
||||
# Modern Unix Replacements
|
||||
alias cat='bat'
|
||||
alias du='dust'
|
||||
alias df='duf'
|
||||
alias grep='rg'
|
||||
alias cp='xcp'
|
||||
alias find='fd'
|
||||
alias top='btm'
|
||||
alias htop='btm'
|
||||
alias burn='command rm'
|
||||
alias rm='rip'
|
||||
|
||||
# Convenience aliases
|
||||
alias free='free -m'
|
||||
alias npkg='nano -w PKGBUILD'
|
||||
alias q='exit'
|
||||
alias :q='exit'
|
||||
alias c='clear'
|
||||
alias h='history'
|
||||
alias lsa='ls -a'
|
||||
alias lsl='ls -l'
|
||||
alias lsla='ls -la'
|
||||
|
||||
# Navigation
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
alias ....='cd ../../..'
|
||||
alias .....='cd ../../../..'
|
||||
|
||||
# Python / Poetry
|
||||
alias pip-upgrade='python -m pip install --upgrade pip'
|
||||
alias pypy='pypy3'
|
||||
alias poem='poetry run python'
|
||||
alias bashpoem='poetry run bash'
|
||||
alias nupoem='poetry run nu'
|
||||
alias zshpoem='poetry run zsh'
|
||||
alias jupyterpoem='poetry run jupyter'
|
||||
|
||||
# Misc
|
||||
alias vim='nvim'
|
||||
alias vi='nvim'
|
||||
alias nix-zsh='nix-shell --command zsh'
|
||||
|
||||
# --- Functions ---
|
||||
|
||||
function chpwd() {
|
||||
if [ -d .git ] && command -v onefetch >/dev/null 2>&1; then
|
||||
onefetch --nerd-fonts
|
||||
fi
|
||||
}
|
||||
|
||||
sysfetch() {
|
||||
if command -v fastfetch >/dev/null 2>&1; then
|
||||
if { [[ "$TERM" == *"kitty"* ]] || [[ "$TERM" == *"ghostty"* ]]; } \
|
||||
&& [ -f "$HOME/.config/fastfetch/kitty.jsonc" ]; then
|
||||
fastfetch --config "$HOME/.config/fastfetch/kitty.jsonc"
|
||||
else
|
||||
fastfetch
|
||||
fi
|
||||
elif command -v neofetch >/dev/null 2>&1; then
|
||||
echo "Why are you still using neofetch? It's deprecated!"
|
||||
neofetch
|
||||
elif command -v screenfetch >/dev/null 2>&1; then
|
||||
screenfetch
|
||||
elif command -v archey >/dev/null 2>&1; then
|
||||
archey
|
||||
elif command -v lsb_release >/dev/null 2>&1; then
|
||||
lsb_release -a
|
||||
elif command -v uname >/dev/null 2>&1; then
|
||||
uname
|
||||
fi
|
||||
}
|
||||
|
||||
# Starship Prompt
|
||||
if command -v starship >/dev/null 2>&1; then
|
||||
eval "$(starship init zsh)"
|
||||
fi
|
||||
|
||||
# Atuin Shell History
|
||||
if command -v atuin >/dev/null 2>&1; then
|
||||
eval "$(atuin init zsh)"
|
||||
fi
|
||||
|
||||
# Direnv
|
||||
if command -v direnv >/dev/null 2>&1; then
|
||||
eval "$(direnv hook zsh)"
|
||||
fi
|
||||
|
||||
# Rbw (Bitwarden)
|
||||
if command -v rbw >/dev/null 2>&1; then
|
||||
eval "$(rbw gen-completions zsh)"
|
||||
fi
|
||||
|
||||
sysfetch
|
||||
Reference in New Issue
Block a user