Skip to content

Instantly share code, notes, and snippets.

@cauesmelo
Last active March 14, 2025 18:49
Show Gist options
  • Select an option

  • Save cauesmelo/95d6b31c1976dcddb7cfbd65a92cedd8 to your computer and use it in GitHub Desktop.

Select an option

Save cauesmelo/95d6b31c1976dcddb7cfbd65a92cedd8 to your computer and use it in GitHub Desktop.
# -------------------------------------------
# Powerlevel10k Instant Prompt (Keep near top)
# -------------------------------------------
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# -------------------------------------------
# Oh-My-Zsh Setup & PATH Customizations
# -------------------------------------------
# Set the location of your oh-my-zsh installation
export ZSH="$HOME/.oh-my-zsh"
# Extend the system PATH with custom directories.
export PATH="/opt/homebrew/opt/unzip/bin:/Users/melocaue/go/bin:$PATH"
# -------------------------------------------
# Zsh Plugins Configuration
# -------------------------------------------
plugins=(
git
)
# -------------------------------------------
# Lazy-load NVM, npm, and node
# -------------------------------------------
# Create lazy-loading wrappers for nvm, npm, and node
for cmd in nvm npm node npx yarn; do
eval "$cmd() { unset -f $cmd; source /opt/homebrew/opt/nvm/nvm.sh; $cmd \"\$@\"; }"
done
# -------------------------------------------
# Aliases
# -------------------------------------------
alias zshcfg="code ~/.zshrc" # Open .zshrc in VS Code
alias zshsrc="source ~/.zshrc" # Reload .zshrc
alias nvimcfg="code ~/.config/nvim/init.vim" # Open Neovim config in VS Code
alias clear-branches="git branch --merged | egrep -v '(^\*|main|hmg|dev)' | xargs git branch -d" # Delete merged branches except main/hmg/dev
# -------------------------------------------
# Themes and Syntax Highlighting
# -------------------------------------------
# Load Powerlevel10k theme
source ~/powerlevel10k/powerlevel10k.zsh-theme
# Enable syntax highlighting and autosuggestions
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
# Load additional Powerlevel10k configuration if available
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# -------------------------------------------
# Pyenv Configuration
# -------------------------------------------
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
# -------------------------------------------
# Additional PATH Modifications
# -------------------------------------------
# Include pipx-installed scripts
export PATH="$PATH:/Users/melocaue/.local/bin"
# Add libpq (PostgreSQL client library) to PATH
export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
# Include Go binaries (from GOPATH/bin)
export PATH=$PATH:$(go env GOPATH)/bin
# -------------------------------------------
# Other Environment Variables
# -------------------------------------------
# Set .NET CLI language to English
export DOTNET_CLI_UI_LANGUAGE=en-US
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment