Last active
December 10, 2015 19:48
-
-
Save pedromarins/4484245 to your computer and use it in GitHub Desktop.
Meus atalhos e configurações do .bash_profile
This file contains hidden or 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
#----------# | |
# shell alias # | |
#----------# | |
alias ..='cd ..' | |
alias ...='cd ../../' | |
alias ....='cd ../../../' | |
alias .....='cd ../../../../' | |
alias ......='cd ../../../../../' | |
alias c="clear" | |
alias ll="ls -lah --color=auto" | |
alias rm='rm -I' | |
alias sulast='sudo $(history -p !-1)' | |
alias install='sudo brew install' | |
mcd() { | |
mkdir -p "$1" && cd "$1"; | |
} | |
cdl () { | |
cd $1 | |
ls | |
} | |
alias tart='tar tzvf' | |
alias tarc='tar czvf' | |
alias tarx='tar xzvf' | |
#----------# | |
# git alias # | |
#----------# | |
alias stt="git status" | |
alias cmt="git add .;git commit -m" | |
alias pull="git pull" | |
alias push="git push origin master" | |
alias diff="git diff|tig" | |
alias gitk='gitk --all &' | |
alias log="git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
workdone() { | |
default="1 day ago" | |
git log [email protected] --pretty=format:"%Cgreen%ar (%h)%n%Creset> %s %b%n" --since="${1:-$default}" --no-merges | |
} | |
#----------# | |
# rails # | |
#----------# | |
export PATH="~/bin:$PATH" | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* | |
COLOR1="\[\033[0;36m\]" | |
COLOR2="\[\033[0;32m\]" | |
COLOR3="\[\033[0;36m\]" | |
COLOR4="\[\033[0;39m\]" | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
rvm_version() { | |
version=$(~/.rvm/bin/rvm-prompt i v g) | |
if [ -z "$version" ]; then | |
echo "" | |
else | |
echo "${version} " | |
fi | |
} | |
PS1="$COLOR2\$(rvm_version)$COLOR3\u@\h$COLOR2:$COLOR1\w$COLOR2\$(parse_git_branch)$COLOR1\\$ $COLOR4$EOP" |
This file contains hidden or 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
[user] | |
name = pedromarins | |
email = [email protected] | |
[color] | |
branch = auto | |
status = auto | |
diff = auto | |
[color "diff"] | |
meta = yellow | |
frag = cyan | |
old = red | |
new = green | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "status"] | |
added = yellow | |
changed = green | |
untracked = cyan |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment