Skip to content

Instantly share code, notes, and snippets.

@IsaiahByDayah
Last active April 10, 2024 20:05
Show Gist options
  • Save IsaiahByDayah/e1f3790ca897b1cf4ad2a0ac99c89788 to your computer and use it in GitHub Desktop.
Save IsaiahByDayah/e1f3790ca897b1cf4ad2a0ac99c89788 to your computer and use it in GitHub Desktop.
# ------------------------------------------------------------
# 0. REFERENCE: https://gist.github.com/natelandau/10654137
# ------------------------------------------------------------
# ------------------------------------------------------------
# 1. Set ENVs
# ------------------------------------------------------------
# Not actually sure what this is for / if they're needed...
# NOTE: Some values may need to be changes when adding to new machine
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Flutter Setup
export PATH="$PATH:/Applications/flutter/bin"
# Java Setup
export PATH="/opt/homebrew/opt/openjdk/bin:$PATH"
# Homebrew setup
export HOMEBREW_PREFIX="/opt/homebrew"; export HOMEBREW_CELLAR="/opt/homebrew/Cellar"; export HOMEBREW_REPOSITORY="/opt/homebrew"; export PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}"; export MANPATH="/opt/homebrew/share/man${MANPATH+:$MANPATH}:"; export INFOPATH="/opt/homebrew/share/info:${INFOPATH:-}";
# NVM Setup
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && . "/opt/homebrew/opt/nvm/nvm.sh" # 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
# Google Cloud SDK
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/isaiahsmith/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/isaiahsmith/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/isaiahsmith/google-cloud-sdk/completion.zsh.inc' ]; then . '/Users/isaiahsmith/google-cloud-sdk/completion.zsh.inc'; fi
# Sets default docker platform for Apple-Silicon chips
export DOCKER_DEFAULT_PLATFORM=linux/amd64
# Path to your oh-my-zsh installation.
export ZSH="/Users/isaiahsmith/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="crcandy"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work)
# See https://github.com/ohmyzsh/ohmyzsh/issues/5765
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git brew)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# -----------------------------
# 2. MAKE TERMINAL BETTER
# -----------------------------
# Format Prompt
autoload -Uz vcs_info
precmd() { vcs_info }
zstyle ':vcs_info:git:*' formats '%b '
setopt PROMPT_SUBST
PROMPT='%B%F{cyan}%~%f%b %F{yellow}${vcs_info_msg_0_}%f'
# NVM Autoload - REF: https://github.com/nvm-sh/nvm#calling-nvm-use-automatically-in-a-directory-with-a-nvmrc-file
autoload -U add-zsh-hook
load-nvmrc() {
local nvmrc_path
nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version
nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$(nvm version)" ]; then
nvm use
fi
elif [ -n "$(PWD=$OLDPWD nvm_find_nvmrc)" ] && [ "$(nvm version)" != "$(nvm version default)" ]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias cp='cp -iv' # Preferred 'cp' implementation
alias mv='mv -iv' # Preferred 'mv' implementation
alias mkdir='mkdir -pv' # Preferred 'mkdir' implementation
alias ll='ls -FGlAhp' # Preferred 'ls' implementation
alias less='less -FSRXc' # Preferred 'less' implementation
cd() { builtin cd "$@"; ll; } # Always list directory contents upon 'cd'
alias cd..='cd ../' # Go back 1 directory level (for fast typers)
alias ..='cd ../' # Go back 1 directory level
alias ...='cd ../../' # Go back 2 directory levels
alias .3='cd ../../../' # Go back 3 directory levels
alias .4='cd ../../../../' # Go back 4 directory levels
alias .5='cd ../../../../../' # Go back 5 directory levels
alias .6='cd ../../../../../../' # Go back 6 directory levels
alias f='open -a Finder ./' # f: Opens current directory in MacOS Finder
alias ~="cd ~" # ~: Go Home
alias c='clear' # c: Clear terminal display
alias zprof="vim ~/.zshrc" # Open profile in zshell shell
alias dev="cd ~/Developer" # Go to "Developer" directory
alias reshell="source ~/.zshrc" # Reloads this profile rc
alias ngrok="/Applications/ngrok" # Alias ngrok application
alias pn="pnpm" # Alias pnpm
on() { lsof -i :$@ } # Logs all apps on port supplied
killon() { lsof -t -i :$@ | xargs kill } # Kills app on supplied port
# GOAT Group Specific
alias sidecar="sidecar:alias:staging"
alias sidecar:web="~/Developer/goat-services/bin/sidecar goat-web staging 9999"
alias sidecar:alias:staging="~/Developer/goat-services/bin/sidecar sell-alias-org staging 9999"
alias sidecar:alias:qa="~/Developer/goat-services/bin/sidecar sell-alias-org qa 9999"
alias sidecar:proxy="mitmweb --mode reverse:http://localhost:9999"
alias proxy="sidecar:proxy"
alias web="cd ~/Developer/goat-web"
alias services="cd ~/Developer/goat-services"
alias docs="cd ~/Developer/engineering-docs/website"
alias sell="cd ~/Developer/sell-alias-org"
alias sneakers="cd ~/Developer/sneakers"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment