74 lines
1.9 KiB
Bash
74 lines
1.9 KiB
Bash
# .zshrc
|
|
|
|
# Path to your Oh My Zsh installation.
|
|
export ZSH="$HOME/.oh-my-zsh"
|
|
|
|
PROMPT="%B%~%b :: "
|
|
RPROMPT="%n@%m"
|
|
|
|
# Plugins
|
|
plugins=(git zsh-syntax-highlighting zsh-autosuggestions)
|
|
|
|
source $ZSH/oh-my-zsh.sh
|
|
|
|
# Golang and GVM
|
|
[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"
|
|
|
|
# Node and NVM (Lazy Load)
|
|
export NVM_DIR="$HOME/.nvm"
|
|
|
|
nvm_load() {
|
|
echo "💤 Waking up NVM..."
|
|
unset -f nvm node npm npx
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
|
"$@"
|
|
}
|
|
|
|
nvm() { nvm_load "nvm" "$@"; }
|
|
node() { nvm_load "node" "$@"; }
|
|
npm() { nvm_load "npm" "$@"; }
|
|
npx() { nvm_load "npx" "$@"; }
|
|
|
|
# Rust and Cargo
|
|
[ -f "$HOME/.cargo/env" ] && source "$HOME/.cargo/env"
|
|
|
|
# Zoxide
|
|
eval "$(zoxide init --cmd cd zsh)"
|
|
|
|
# Source Aliases & Secrets
|
|
[ -f ~/.zsh_aliases ] && source ~/.zsh_aliases
|
|
[ -f ~/.zsh_secrets ] && source ~/.zsh_secrets
|
|
|
|
# Conda (Dynamic Path)
|
|
# __conda_setup="$('$HOME/Programming/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
|
|
# if [ $? -eq 0 ]; then
|
|
# eval "$__conda_setup"
|
|
# else
|
|
# if [ -f "$HOME/Programming/miniconda3/etc/profile.d/conda.sh" ]; then
|
|
# . "$HOME/Programming/miniconda3/etc/profile.d/conda.sh"
|
|
# else
|
|
# export PATH="$HOME/Programming/miniconda3/bin:$PATH"
|
|
# fi
|
|
# fi
|
|
# unset __conda_setup
|
|
|
|
# Add to PATH
|
|
export PATH="$HOME/.local/bin:$PATH"
|
|
|
|
# ---------------------------------------------------------------------
|
|
# DYNAMIC VS CODE PATH (Run LAST)
|
|
# ---------------------------------------------------------------------
|
|
|
|
# Get Windows Username
|
|
WIN_USER=$(cmd.exe /c 'echo %USERNAME%' 2>/dev/null | tr -d '\r')
|
|
|
|
# Define potential paths (User Install vs System Install)
|
|
VSCODE_USER="/mnt/c/Users/$WIN_USER/AppData/Local/Programs/Microsoft VS Code/bin"
|
|
VSCODE_SYS="/mnt/c/Program Files/Microsoft VS Code/bin"
|
|
|
|
# Add whichever exists to PATH
|
|
if [ -d "$VSCODE_USER" ]; then
|
|
export PATH="$PATH:$VSCODE_USER"
|
|
elif [ -d "$VSCODE_SYS" ]; then
|
|
export PATH="$PATH:$VSCODE_SYS"
|
|
fi |