Skip to content

Instantly share code, notes, and snippets.

@kenziebottoms
Last active June 25, 2024 18:20
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="kenzie"
ZSH_THEME="kenziebottoms"
HYPHEN_INSENSITIVE="true"
plugins=(
git
cdbk
)
source $ZSH/oh-my-zsh.sh
## 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'
alias gmm='git merge master'
alias grm='git rebase master'
alias grc='git rebase --continue'
## 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.='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 {
lsof -t -i tcp:$1 | xargs kill -9
}
## 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