mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-02-20 15:18:05 +00:00
155 lines
3.8 KiB
Plaintext
155 lines
3.8 KiB
Plaintext
# --- 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 ---
|
|
if [[ -f ~/.config/path.env ]]; then
|
|
for dir in $(cat ~/.config/path.env); do
|
|
expanded_dir=${~dir}
|
|
if [[ -d $expanded_dir ]]; then
|
|
path=($expanded_dir $path)
|
|
fi
|
|
done
|
|
fi
|
|
|
|
typeset -U 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
|
|
}
|
|
|
|
# --- Simple, Self-Bootstrapping Syntax Highlighting ---
|
|
ZSH_SH_DIR="$HOME/.local/share/zsh-syntax-highlighting"
|
|
if [ ! -d "$ZSH_SH_DIR" ]; then
|
|
echo "Cloning zsh-syntax-highlighting..."
|
|
git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting.git "$ZSH_SH_DIR" > /dev/null 2>&1
|
|
fi
|
|
[ -f "$ZSH_SH_DIR/zsh-syntax-highlighting.zsh" ] && source "$ZSH_SH_DIR/zsh-syntax-highlighting.zsh"
|
|
|
|
# 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
|