Last active
December 17, 2015 09:48
-
-
Save lucian303/5589806 to your computer and use it in GitHub Desktop.
mac .zshrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="af-magic" | |
# Example aliases | |
# alias zshconfig="mate ~/.zshrc" | |
# alias ohmyzsh="mate ~/.oh-my-zsh" | |
# Set to this to use case-sensitive completion | |
# CASE_SENSITIVE="true" | |
# Comment this out to disable bi-weekly auto-update checks | |
# DISABLE_AUTO_UPDATE="true" | |
# Uncomment to change how often before auto-updates occur? (in days) | |
# export UPDATE_ZSH_DAYS=13 | |
# Uncomment following line if you want to disable colors in ls | |
# DISABLE_LS_COLORS="true" | |
# Uncomment following line if you want to disable autosetting terminal title. | |
# DISABLE_AUTO_TITLE="true" | |
# Uncomment following line if you want to disable command autocorrection | |
# DISABLE_CORRECTION="true" | |
# Uncomment following line if you want red dots to be displayed while waiting for completion | |
COMPLETION_WAITING_DOTS="true" | |
# Uncomment 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" | |
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) | |
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ | |
# Example format: plugins=(rails git textmate ruby lighthouse) | |
plugins=(git macports python rvm symfony2 themes svn pip osx node history golang go github django composer colorize autoenv zsh-syntax-highlighting) | |
source $ZSH/oh-my-zsh.sh | |
# Customize to your needs... | |
export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/heroku/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/apache2/bin:/opt/local/lib/mysql55/bin:/opt/local/lib/php/pear/bin/:/usr/local/bin:/usr/local/:/usr/local/phalcon-devtools:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/go/bin:/usr/local/phalcon-devtools:$PATH | |
export PTOOLSPATH=/usr/local/phalcon-devtools | |
export MANPATH=/opt/local/share/man:$MANPATH | |
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig | |
export EDITOR='sub' | |
#prevent accidental deletion / move / copy | |
alias rm='rm -i' | |
alias cp='cp -i' | |
alias mv='mv -i' | |
# move dirs | |
alias ..='cd ..' | |
alias ...='cd ../../' | |
alias ....='cd ../../../' | |
alias .....='cd ../../../../' | |
alias ......='cd ../../../../../' | |
# some more ls aliases | |
alias lsd='ls -lahG' | |
alias lsdd='ls -lahdG' | |
alias nano='nano -u' | |
alias mapa='cd /Applications/MAMP/conf' | |
alias add='svn add $1' | |
alias brc='sub ~/.bashrc' | |
alias ci='svn ci -m "$1"' | |
alias cl='clear' | |
alias d='cd ~/Desktop' | |
alias ex='exit' | |
alias fd='grep -HIirn -A 1' | |
alias home='cd ~' | |
alias l='ls -llhAG' | |
alias ll='ls -llhG' | |
alias log='svn log|more' | |
alias nosvn='tar --exclude=*.svn -czvf $1 $2' | |
alias nosvn2='|grep -v "svn"' | |
alias ns='nslookup' | |
alias perms='svn -R ps perms 777 $1' | |
alias rd='rmdir' | |
alias src='source ~/.zshrc' | |
alias st='svn st ' | |
alias v='vim' | |
alias n='nano' | |
alias log='cd /var/log/; l' | |
alias pu='pushd $1' | |
alias po='popd' | |
alias hh='history | tail -n 30' | |
alias h='history' | |
alias a='alias' | |
alias sup='svn up' | |
alias stat='svn status' | |
alias dif='diff -wyW 200 --suppress-common-lines $1 $2' | |
alias tarr='tar czvf $1 $2' | |
alias untar='tar xzvf $1' | |
alias tarb='tar cjvf $1 $2' | |
alias untarb='tar xjvf $1' | |
alias v='vi' | |
alias vi='vim' | |
alias 777='sudo chmod -R 777 $1' | |
alias 7777='chmod -R 777 $1' | |
alias msql='/Applications/MAMP/Library/bin/mysql' | |
alias msqla='/Applications/MAMP/Library/bin/mysqladmin' | |
alias msqld='/Applications/MAMP/Library/bin/mysqldump' | |
alias ht='cd ~/Desktop/htdocs' | |
alias mplog='tail -fn40 /Applications/MAMP/logs/php_error.log' | |
alias malog='tail -fn40 /Applications/MAMP/logs/apache_error_log' | |
alias maalog='tail -fn40 /Applications/MAMP/logs/apache_access_log' | |
alias mmlog='tail -fn40 /Applications/MAMP/logs/mysql_error_log' | |
alias unbz='tar xjvf $1' | |
alias pss='ps axvh' | |
alias topp='top -ocpu -O+rsize' | |
alias mphpi='sub /Applications/MAMP/conf/php5/php.ini' | |
alias mbin='cd /Applications/MAMP/Library/bin' | |
alias phpi='sub /opt/local/etc/php54/php.ini' | |
alias apa='sub /opt/local/apache2/conf/httpd.conf' | |
alias apa2='cd /opt/local/apache2/conf/extra' | |
alias vh='sub /opt/local/apache2/conf/extra/httpd-vhosts.conf' | |
alias myconf="sub /opt/local/etc/mysql55/my.cnf" | |
alias sql='mysql -uroot -proot' | |
alias sqlload='mysql -uroot -proot < ' | |
alias hosts='sub /etc/hosts' | |
alias proj='cd ~/Desktop/projects' | |
alias dow='cd ~/Downloads' | |
#alias devmel='sshfs :/home/lhontau/ ~/Desktop/htdocs/ -o follow_symlinks' | |
alias s='sub' | |
alias down='s el down; s ell down' | |
alias p='cd ~/Desktop/projects' | |
alias gpull='git pull' | |
alias gst='git status' | |
alias gco='git commit' | |
alias cleardns='dscacheutil -flushcache' | |
alias gpush='git push' | |
alias gadd='git add' | |
alias grm='git rm' | |
alias glog='git lg' #fancy log | |
alias taill='tail -fn1000' | |
alias punit='phpunit --colors .' | |
alias mamp='cd /Applications/MAMP' | |
alias plog='taill /var/log/php_errors.log' | |
alias alog='taill /opt/local/apache2/logs/error_log' | |
alias acc='taill /opt/local/apache2/logs/access_log' | |
alias mlog='taill /var/log/mysql_error.log' | |
alias slow='taill /var/log/mysql_slow1.log' | |
alias lr='ls -R | grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/ /'\'' -e '\''s/-/|/'\''' | |
alias glog="git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
alias hi='history | ack' | |
alias py='python' | |
alias doc='cd ~/Documents' | |
alias rsa='sudo apachectl restart' | |
alias astop='sudo apachectl stop' | |
alias astart='sudo apachectl start' | |
alias my='sudo mysqld_safe &' | |
alias killmy='sudo pkill mysqld' | |
alias rsall="stop; start" | |
alias zrc='sub ~/.zshrc' | |
# apache2 | |
alias apache2_start='sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist' | |
alias apache2_stop='sudo launchctl unload -w /Library/LaunchDaemons/org.macports.apache2.plist' | |
alias apache2_restart='apache2_stop; apache2_start;' | |
# mysql | |
alias mysql_start='sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql55-server.plist' | |
alias mysql_stop='sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql55-server.plist' | |
alias mysqlrestart='mysql_stop; mysql_start;' | |
alias starta="apache2_restart; mysql_restart" | |
alias stopa="apache2_stop; mysql_stop" | |
# nginx | |
alias nginx_start='sudo launchctl load -w /Library/LaunchDaemons/org.macports.nginx.plist' | |
alias nginx_stop='sudo launchctl unload -w /Library/LaunchDaemons/org.macports.nginx.plist' | |
alias nginx_restart='nginx_stop; nginx_start;' | |
#php-fpm | |
alias fpm_start='sudo launchctl load -w /Library/LaunchDaemons/org.macports.php54-fpm.plist' | |
alias fpm_stop='sudo launchctl unload -w /Library/LaunchDaemons/org.macports.php54-fpm.plist' | |
alias fpm_restart='fpm_stop; fpm_start' | |
#sy2 | |
alias sy2sym='php app/console assets:install --symlink' | |
alias sy2perms='777 app/cache' | |
alias sy2update='sy2perms; composer update; sy2perms' | |
alias sy2cleardev='sy2perms; app/console cache:clear; app/console cache:warmup; sy2perms' | |
alias sy2clearprod='sy2perms; app/console cache:clear --env=prod --no-debug; app/console cache:warmup --env=prod --no-debug; sy2perms' | |
alias sy2clear='sy2cleardev; sy2clearprod' | |
alias sy2autoload='sy2perms; composer install --optimize-autoloader --symlink; sy2perms' | |
# Usage: | |
# $ cd /path/to/project/src/ | |
# $ mark code # Will create a new shortcut. | |
# # Becomes interactive if a shortcut already exists | |
# # m is an alias for mark. You can also `m code` | |
# | |
# $ code # From now on, running this anywhere in the shell | |
# # will put you in /path/to/project/src/code | |
# | |
# $ unmark code # Will remove the symlink and is interactive | |
# # u is an alias for unmark. You can also `u code` | |
SHELLMARKSDIR="$HOME/.shellmarks" | |
mkdir -p $SHELLMARKSDIR | |
function mark_alias { alias $(basename $1)="cd -P $1"; } | |
function mark { # Mark a directory | |
symlink=$SHELLMARKSDIR/$1 | |
ln -ivhs "$(pwd)" $symlink && mark_alias $symlink | |
} | |
alias m=mark | |
function unmark { # Remove a mark | |
symlink=$SHELLMARKSDIR/$1 | |
rm -iv $symlink | |
if [ ! -f $symlink ]; then | |
unalias $1 | |
fi | |
} | |
alias u=unmark | |
function shellmarks { # List all existing marks | |
LINK_COLOR=$'\e[1;35m' | |
RESET_COLOR=$'\e[0m' | |
for symlink in $SHELLMARKSDIR/*; do | |
echo "${LINK_COLOR} $(basename $symlink) ${RESET_COLOR} -> $(readlink $symlink)" | |
done | |
} | |
for symlink in $SHELLMARKSDIR/*; do # load all existing symlinks as aliases | |
mark_alias $symlink | |
test -e $symlink || rm $symlink # remove symlinks if source does not exist | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment