Created
January 29, 2026 10:25
-
-
Save Richard87/74da485ac8897f580be1b9c916bab7ed to your computer and use it in GitHub Desktop.
.zshrc-macos
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
| zmodload zsh/datetime | |
| DISABLE_AUTO_UPDATE="true" | |
| DISABLE_MAGIC_FUNCTIONS="true" | |
| DISABLE_COMPFIX="true" | |
| ZSH_START_TIME=$EPOCHREALTIME | |
| printf "[$(date +%H:%M:%S)] Loading ZSH config...\n" | |
| export ZSH="$HOME/.oh-my-zsh" | |
| unsetopt pathdirs | |
| ZSH_THEME="robbyrussell" | |
| COMPLETION_WAITING_DOTS="true" | |
| __kube_ps1() | |
| { | |
| yq '.current-context as $cur | .contexts[] | select(.name == $cur) | [$cur, .context.namespace] | join(":")' $HOME/.kube/config | |
| } | |
| function ns() { | |
| if [[ -n $1 ]] | |
| then | |
| kubectl config set-context --current --namespace=$1 | |
| kubectl config view --minify | grep namespace: | |
| else | |
| kubectl get ns | |
| fi | |
| } | |
| printf "[$(date +%H:%M:%S)] Adding SSH keys...\n" | |
| ssh-add --apple-load-keychain -q | |
| printf "[$(date +%H:%M:%S)] Loading plugins...\n" | |
| plugins=( | |
| git | |
| kubectl | |
| azure | |
| helm | |
| terraform | |
| ) | |
| printf "[$(date +%H:%M:%S)] Sourcing Oh My Zsh...\n" | |
| source $ZSH/oh-my-zsh.sh | |
| PROMPT="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ ) %{$fg[cyan]%}%3~%{$reset_color%}" | |
| PROMPT+=' %{$fg_bold[green]%}k:$(__kube_ps1)%{$reset_color%} $(git_prompt_info)' | |
| export PATH="/Applications/Docker.app/Contents/Resources/bin:/usr/local/go/bin:$HOME/.dotnet:$HOME/go/bin:/opt/mssql-tools18/bin:$HOME/.krew/bin:$HOME/.bin:$HOME/.istioctl/bin:/opt/nvim-linux-x86_64/bin:/usr/local/bin:/opt/homebrew/bin:$PATH" | |
| export KUBE_EDITOR="code -w" | |
| export GIT_EDITOR=vim | |
| export DOTNET_ROOT=/usr/share/dotnet | |
| export BROWSER=~/.win-open.sh | |
| printf "[$(date +%H:%M:%S)] Loading NVM...\n" | |
| export NVM_DIR="$HOME/.nvm" | |
| [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" --no-use # This loads nvm | |
| [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion | |
| alias k="kubectl" | |
| alias scale-canary-up='flux resume kustomization radix-cicd-canary && k scale deploy -n radix-cicd-canary --all --replicas=1' | |
| alias scale-canary-down='flux suspend kustomization radix-cicd-canary && k delete scaledobject cron-scaledobject -n radix-cicd-canary && k scale deploy -n radix-cicd-canary --all --replicas=0' | |
| alias reload-tokens='kubelogin remove-cache-dir && az logout && az login --only-show-errors --query name && kubelogin convert-kubeconfig -l azurecli' | |
| printf "[$(date +%H:%M:%S)] Loading RX completions...\n" | |
| source <(rx completion zsh) | |
| printf "[$(date +%H:%M:%S)] Loading ZSH completions...\n" | |
| autoload -Uz compinit | |
| if [ "$(date +'%j')" != "$(stat -f '%Sm' -t '%j' ~/.zcompdump 2>/dev/null)" ]; then | |
| compinit | |
| else | |
| compinit -C | |
| fi | |
| # End of Docker CLI completions | |
| [[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path zsh)" | |
| HOMEBREW_NO_ENV_HINTS=1 | |
| ZSH_DURATION=$(( EPOCHREALTIME - ZSH_START_TIME )) | |
| printf "[$(date +%H:%M:%S)] ZSH config loaded. Duration: %.3fs\n" $ZSH_DURATION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment