Last active
August 29, 2015 13:58
-
-
Save thauanz/9980267 to your computer and use it in GitHub Desktop.
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
DULL=0 | |
BRIGHT=1 | |
FG_BLACK=30 | |
FG_RED=31 | |
FG_GREEN=32 | |
FG_YELLOW=33 | |
FG_BLUE=34 | |
FG_VIOLET=35 | |
FG_CYAN=36 | |
FG_WHITE=37 | |
FG_NULL=00 | |
BG_BLACK=40 | |
BG_RED=41 | |
BG_GREEN=42 | |
BG_YELLOW=43 | |
BG_BLUE=44 | |
BG_VIOLET=45 | |
BG_CYAN=46 | |
BG_WHITE=47 | |
BG_NULL=00 | |
# ANSI Escape Commands | |
ESC="\033" | |
NORMAL="\[$ESC[m\]" | |
RESET="\[$ESC[${DULL};${FG_WHITE};${BG_NULL}m\]" | |
BLACK="\[$ESC[${DULL};${FG_BLACK}m\]" | |
RED="\[$ESC[${DULL};${FG_RED}m\]" | |
GREEN="\[$ESC[${DULL};${FG_GREEN}m\]" | |
YELLOW="\[$ESC[${DULL};${FG_YELLOW}m\]" | |
BLUE="\[$ESC[${DULL};${FG_BLUE}m\]" | |
VIOLET="\[$ESC[${DULL};${FG_VIOLET}m\]" | |
CYAN="\[$ESC[${DULL};${FG_CYAN}m\]" | |
WHITE="\[$ESC[${DULL};${FG_WHITE}m\]" | |
BRIGHT_BLACK="\[$ESC[${BRIGHT};${FG_BLACK}m\]" | |
BRIGHT_RED="\[$ESC[${BRIGHT};${FG_RED}m\]" | |
BRIGHT_GREEN="\[$ESC[${BRIGHT};${FG_GREEN}m\]" | |
BRIGHT_YELLOW="\[$ESC[${BRIGHT};${FG_YELLOW}m\]" | |
BRIGHT_BLUE="\[$ESC[${BRIGHT};${FG_BLUE}m\]" | |
BRIGHT_VIOLET="\[$ESC[${BRIGHT};${FG_VIOLET}m\]" | |
BRIGHT_CYAN="\[$ESC[${BRIGHT};${FG_CYAN}m\]" | |
BRIGHT_WHITE="\[$ESC[${BRIGHT};${FG_WHITE}m\]" | |
#Projetos | |
alias raro='cd rarolabs/' | |
# Processes | |
alias tu='top -o cpu' # cpu | |
alias tm='top -o vsize' # memory | |
alias e='exit' | |
alias k9="killall -9" | |
# TextMate | |
alias mt="mate" | |
alias mtd="mate ." | |
# RVM | |
alias rvmu="rvm use" | |
# some more ls aliases | |
alias ll='ls -alF' | |
alias la='ls -A' | |
alias l='ls -CF' | |
#rails | |
alias r='rails' | |
# RSpec | |
alias rs="rspec" | |
alias it="infinity_test" | |
# Rails any version | |
alias rp='touch tmp/restart.txt' | |
alias tld='tail -f log/development.log' | |
alias tlt='tail -f log/test.log' | |
alias tlp='tail -f log/production.log' | |
alias tl='tail -f log/*.log' | |
# Git | |
alias ungit="rm -rf .git" | |
alias gcl='git clone' | |
alias gl='git log' | |
alias glp='git log --pretty=oneline' | |
alias gb='git branch' | |
alias gba='git branch -a' | |
alias gc='git commit -v' | |
alias gcam='git commit -am' | |
alias gcm='git commit -m' | |
alias gco='git checkout' | |
alias ga='git add .' | |
alias gd='git diff' | |
alias gdm='git diff master' | |
alias gnp="git-notpushed" | |
alias gpl='git pull' | |
alias gps='git push' | |
alias gph='git push heroku master' | |
alias gst='git status' | |
alias gru='git reset --hard HEAD' | |
alias eg='mate .git/config' | |
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
PROMPT_COMMAND='history -a' | |
# don't put duplicate lines in the history. See bash(1) for more options | |
# ... or force ignoredups and ignorespace | |
HISTCONTROL=ignoredups:ignorespace | |
# append to the history file, don't overwrite it | |
shopt -s histappend | |
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) | |
export HISTSIZE=100000 | |
HISTFILESIZE=2000 | |
# check the window size after each command and, if necessary, | |
# update the values of LINES and COLUMNS. | |
shopt -s checkwinsize | |
# enable color support of ls and also add handy aliases | |
if [ -x /usr/bin/dircolors ]; then | |
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" | |
alias ls='ls --color=auto' | |
#alias dir='dir --color=auto' | |
#alias vdir='vdir --color=auto' | |
alias grep='grep --color=auto' | |
alias fgrep='fgrep --color=auto' | |
alias egrep='egrep --color=auto' | |
fi | |
export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups | |
export HISTCONTROL=ignoreboth | |
# works with rvm | |
__ruby_version() { | |
which ruby | cut -d/ -f6 | |
} | |
__gemset() { | |
echo $GEM_PATH | cut -d@ -f2 | cut -d: -f1 | |
} | |
__git_branch() { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo "("${ref#refs/heads/}")" | |
} | |
if [ -f ~/.bash_aliases ]; then | |
. ~/.bash_aliases | |
fi | |
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then | |
. /etc/bash_completion | |
fi | |
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/usr/local/mysql/lib/" | |
export PATH="/usr/local/mysql/bin:$PATH" | |
PS1="$BLUE\n\u:$RED\w $GREEN(\$(__ruby_version)) $VIOLET\$(__git_branch) ${NORMAL}\$ ${RESET}" | |
[[ -s ~/.bashrc ]] && source ~/.bashrc | |
export PATH=/opt/local/bin:/opt/local/sbin:$PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment