Skip to content

Instantly share code, notes, and snippets.

@kenziebottoms
Last active November 21, 2022 01:38
Show Gist options
  • Save kenziebottoms/3856c0e8fc70b6f6f7ce1327af99223a to your computer and use it in GitHub Desktop.
Save kenziebottoms/3856c0e8fc70b6f6f7ce1327af99223a to your computer and use it in GitHub Desktop.
oh-my-zsh shortcuts
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=~/.oh-my-zsh
DEFAULT_USER="mckenzie"
ZSH_THEME="kenziebottoms"
# CASE_SENSITIVE="true"
HYPHEN_INSENSITIVE="true"
# DISABLE_AUTO_UPDATE="true"
# export UPDATE_ZSH_DAYS=13
# DISABLE_LS_COLORS="true"
# DISABLE_AUTO_TITLE="true"
# ENABLE_CORRECTION="true"
# COMPLETION_WAITING_DOTS="true"
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# HIST_STAMPS="mm/dd/yyyy"
# ZSH_CUSTOM=/path/to/new-custom-folder
plugins=(
git
cdbk
)
source $ZSH/oh-my-zsh.sh
# User configuration
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
## GIT ##
alias gc='git commit -m'
alias gglm='git pull origin master'
alias gglo='git pull origin'
alias gph='git push heroku'
alias gar='git init && git remote add origin'
alias gfap='git fetch -ap'
alias gca='git commit --amend'
alias gcaa='git add --all && git commit --amend'
alias gru='git remote set-url origin'
alias gaac='git add --all && git commit -m'
alias gs='git stash'
alias gsa='git stash apply'
## ZSH ##
alias za='sudo vi ~/.zshrc'
alias zr='. ~/.zshrc'
## NODE ##
alias ns='npm start'
alias ni='npm install'
alias nig='npm install -g'
alias naf='npm audit fix'
alias nu='npm update'
alias nrd='npm run dev'
alias nt='npm test'
alias jw='jest --watch .'
## MISC ##
alias c.='zr && code .'
alias rmf='rm -rf'
alias sup='sudo apt-get update'
alias si='sudo apt-get install'
alias pgs='pg_ctl -D /usr/local/var/postgres start'
## SHORTCUTS ##
alias vs='cd ~/Library/"Application Support"/Code/User/snippets/ && c.'
## FUNCTIONS ##
function kill_by_port {
kill $(lsof -t -i :$1)
}
## DUMB DISPLAY SHIT ##
clear
local zero='%([BSUbfksu]|([FK]|){*})'
SPACE=" %.0s"
DATE=$(date +"%D %I:%M %p")
DATE_LENGTH=${#${(S%%)DATE//$~zero/}}
PWD=$(pwd)
PWD_LENGTH=${#${(S%%)PWD//$~zero/}}
printf "\033[7;35m"
printf " %.0s" {1..$((39 - $DATE_LENGTH / 2))}
printf $DATE
if [ $(($DATE_LENGTH % 2)) -eq 0 ]; then
printf " %.0s"
fi
printf " %.0s" {1..$((40 - $DATE_LENGTH / 2))}
printf "\033[0m"
## ASCII ART
cat /etc/motd
printf "\033[7;36m"
printf " %.0s" {1..$((39 - $PWD_LENGTH / 2))}
printf $PWD
if [ $(($PWD_LENGTH % 2)) -eq 0 ]; then
printf " %.0s"
fi
printf " %.0s" {1..$((40 - $PWD_LENGTH / 2))}
printf "\033[0m\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment