Advanced upgrade :D

This commit is contained in:
MangoPig
2025-12-03 02:34:09 +00:00
parent 5b722cc099
commit dc33ab44c4
4 changed files with 298 additions and 61 deletions

96
.zshrc
View File

@@ -1,4 +1,4 @@
# .zshrc
# .zshrc
# Path to your Oh My Zsh installation.
export ZSH="$HOME/.oh-my-zsh"
@@ -7,56 +7,68 @@ PROMPT="%B%~%b :: "
RPROMPT="%n@%m"
# Plugins
plugins=(
git
zsh-syntax-highlighting
zsh-autosuggestions
)
plugins=(git zsh-syntax-highlighting zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
# Add to PATH
export PATH="$HOME/.local/bin:$PATH"
# Golang and GVM
[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"
# GVM
[[ -s "/home/mangopig/.gvm/scripts/gvm" ]] && source "/home/mangopig/.gvm/scripts/gvm"
# Golang
# Ensure Go binary is in PATH
export GOROOT=/usr/local/go
export GOPATH=$HOME/Programming/go
export GOBIN=$GOPATH/bin
# Set PATH correctly
export PATH=$GOROOT/bin:$GOBIN:$GOPATH/bin:$PATH
# NVM
# Node and NVM (Lazy Load)
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
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 the aliases file
source ~/.zsh_aliases
# Source Aliases & Secrets
[ -f ~/.zsh_aliases ] && source ~/.zsh_aliases
[ -f ~/.zsh_secrets ] && source ~/.zsh_secrets
# Source 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
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/mangopig/Programming/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/mangopig/Programming/miniconda3/etc/profile.d/conda.sh" ]; then
. "/home/mangopig/Programming/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/home/mangopig/Programming/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
# 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