Skip to content

Instantly share code, notes, and snippets.

@dbrax
Forked from kenziebottoms/.zshrc
Last active May 19, 2021 07:03
Show Gist options
  • Save dbrax/a9540e1361b1d135788fdefb455f4e56 to your computer and use it in GitHub Desktop.
Save dbrax/a9540e1361b1d135788fdefb455f4e56 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="emmanuel"
ZSH_THEME="emmastyle"
# 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 g="git"
alias gpush="git push"
alias gpull="git pull"
alias pas="php artisan serve"
alias pa="php artisan"
alias cu="composer update"
alias ci="composer install"
## ZSH ##
alias za='sudo nano ~/.zshrc'
alias zr='. ~/.zshrc'
## NODE ##
alias ns='npm start'
alias ni='npm install'
alias naf='npm audit fix'
alias nu='npm update'
alias nrd='npm run dev'
alias nt='npm test'
## 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