Created
December 7, 2025 04:14
-
-
Save SammyLin/3d30dcf3abc6be227319a97e200e1bb4 to your computer and use it in GitHub Desktop.
Clean ZSH Config - Starship + Zoxide + DevOps tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ==== Clean ZSH Config ==== | |
| # Fast, minimal, with essential DevOps tooling | |
| # https://gist.github.com/YOUR_USERNAME/xxx | |
| # --- Core Env --- | |
| export SHELL=/bin/zsh | |
| export EDITOR=nvim | |
| export LANG=en_US.UTF-8 | |
| export LC_ALL=en_US.UTF-8 | |
| # --- Homebrew --- | |
| if [[ -x "/opt/homebrew/bin/brew" ]]; then | |
| eval "$(/opt/homebrew/bin/brew shellenv)" | |
| fi | |
| # --- PATH --- | |
| export PATH="$HOME/bin:/usr/local/bin:/opt/homebrew/bin:$PATH" | |
| export PATH="$HOME/.local/bin:$PATH" | |
| # --- History --- | |
| HISTSIZE=5000 | |
| SAVEHIST=5000 | |
| setopt INC_APPEND_HISTORY SHARE_HISTORY | |
| bindkey -v | |
| bindkey '^R' history-incremental-search-backward | |
| # --- Completion --- | |
| autoload -Uz compinit && compinit | |
| # --- Plugins (light + fast) --- | |
| # fast highlight | |
| type brew &>/dev/null && source "$(brew --prefix)/share/zsh-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh" 2>/dev/null | |
| # autosuggestions | |
| [[ -r "$(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh" ]] && source "$(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh" | |
| # --- FZF --- | |
| [[ -f ~/.fzf.zsh ]] && source ~/.fzf.zsh | |
| # --- Aliases --- | |
| alias l='ls -lah' | |
| alias ..='cd ..' | |
| alias ...='cd ../..' | |
| alias k='kubectl' | |
| alias g='git' | |
| # GCP config switcher (use fzf) | |
| function gpick() { | |
| local cfg=$(gcloud config configurations list --format="value(name)" | fzf) | |
| [ -n "$cfg" ] && gcloud config configurations activate "$cfg" | |
| } | |
| # --- Lazy NVM --- | |
| load_nvm() { | |
| export NVM_DIR="$HOME/.nvm" | |
| [[ -s "$(brew --prefix nvm)/nvm.sh" ]] && . "$(brew --prefix nvm)/nvm.sh" | |
| } | |
| alias nvml="load_nvm" | |
| # --- Python venv auto-load --- | |
| [[ -f "$PWD/.venv/bin/activate" ]] && source "$PWD/.venv/bin/activate" | |
| # --- Starship Prompt --- | |
| command -v starship >/dev/null && eval "$(starship init zsh)" | |
| # --- Cloud SDK completion --- | |
| if [[ -f '/opt/homebrew/share/google-cloud-sdk/path.zsh.inc' ]]; then | |
| . '/opt/homebrew/share/google-cloud-sdk/path.zsh.inc' | |
| fi | |
| if [[ -f '/opt/homebrew/share/google-cloud-sdk/completion.zsh.inc' ]]; then | |
| . '/opt/homebrew/share/google-cloud-sdk/completion.zsh.inc' | |
| fi | |
| # --- Zoxide --- | |
| command -v zoxide >/dev/null && eval "$(zoxide init zsh)" | |
| # --- LS Colors --- | |
| export CLICOLOR=1 | |
| export LSCOLORS=ExGxFxdaCxDaDahbadacec | |
| alias ls='ls -G' | |
| # ==== Custom additions below ==== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment