Skip to content

Instantly share code, notes, and snippets.

@atorscho
Last active April 23, 2022 09:34
Show Gist options
  • Save atorscho/886d2b0072fb7b23b565 to your computer and use it in GitHub Desktop.
Save atorscho/886d2b0072fb7b23b565 to your computer and use it in GitHub Desktop.
ZSH Configuration
# Load additional aliases
source $HOME/.zshrc-aliases
#################
### FUNCTIONS ###
#################
# Create a directory and open it right after
mkcd() {
mkdir $1 && cd "$_";
}
# Add an alias
addalias() {
echo "alias $1=\"$2\"" >> $HOME/.zshrc-aliases;
src;
}
# Start a server
sv() {
if [ -f "webpack.mix.js" ]; then
yarn watch $@
elif [ -f "artisan" ]; then
composer serve $@ || php artisan serve $@
else
yarn serve $@
fi
}
# ZSH Shortcuts
alias zshconf="code ~/.zshrc"
alias aliases="code ~/.zshrc-aliases"
alias src="source ~/.zshrc; source ~/.zshrc-aliases"
# Utilities
alias archive="tar -czvf"
# Git Commands Shortcuts
alias ga="git add"
alias gaa="git add --all"
alias gc="git commit -m"
alias gs="git status"
alias gp="git push"
alias gu="git pull"
alias grm="git rm"
# Laravel Shortcuts
alias art="php artisan"
alias seed="php artisan db:seed"
alias mm="php artisan make:model"
alias mr="php artisan migrate"
alias mf="php artisan migrate:fresh"
alias mfs="php artisan migrate:fresh --seed"
alias routes="php artisan route:list --except-vendor"
alias routesa="php artisan route:list"
# Sites & Projects
alias sites="cd ~/Sites"
# Composer & Node Binaries
alias pest="./vendor/bin/pest"
#####################################
##### ALIASES ADDED VIA COMMAND #####
#####################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment