Created
October 29, 2014 11:34
-
-
Save 9point6/d9f3e9df9edafed1167c to your computer and use it in GitHub Desktop.
Bash RC
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
updateWindowTitle() | |
{ | |
echo -ne "\033];Home - ${HOSTNAME}:${PWD/$HOME/~}\007"; | |
}; | |
[[ -s ~/.nvm/nvm.sh ]] && . ~/.nvm/nvm.sh | |
# Aliases | |
alias cd="pushd" | |
alias bd="popd" | |
alias l="ls -CF --color=always" | |
alias la="ls -A --color=always" | |
alias ll="ls -l --color=always" | |
alias psx="ps -auxw | grep $1" | |
alias cd..="cd .." | |
alias rlp="clear; . ~/.profile" | |
# Git stuff | |
alias gp="git up" | |
alias gs="gp && git push --all && git push --tags" | |
alias gfp="gs && git checkout develop" | |
alias gfrs="git flow release start" | |
alias gfrf="git flow release finish" | |
gfr() | |
{ | |
if [ -z "$1" ] | |
then | |
ver=$(node -e "a=require('./package.json');console.log(a.version);"); | |
line=$(git tag | grep $ver) | |
if [ $? -eq 1 ] | |
then | |
gfrs $ver && gfrf $ver; | |
else | |
echo "Version not bumped in package.json" | |
fi | |
else | |
gfrs $1 && gfrf $1; | |
fi | |
}; | |
gitCommit() | |
{ | |
if [ -z "$1" ] | |
then | |
git commit -a && gs | |
else | |
git commit -a -m "$1" && gs | |
fi | |
}; | |
alias gc=gitCommit | |
# Linux only stuff | |
alias tmux="tmux -2" | |
alias plz="sudo !!" | |
alias aptug="sudo aptitude full-upgrade" | |
alias aptup="sudo aptitude update" | |
alias aptin="sudo aptitude install" | |
alias aptrm="sudo aptitude remove" | |
calc(){ awk "BEGIN{ print $* }"; }; | |
mkcd(){ mkdir -p "$*"; cd "$*"; }; | |
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit" | |
export EDITOR=vim | |
export INPUTRC=~/.inputrc | |
export PROMPT_COMMAND='PS1="\\n\\[\\033[1;35m\\][\A]\\[\\033[1;36m\\][\!]\\[\\033[1;33m\\][\j]\\[\\033[1;34m\\][\u@\h]\n\`if [[ \$? = "0" ]]; then echo "\\[\\033[1\\\;32m\\]"; else echo "\\[\\033[1\\\;31m\\]"; fi\`[\`if [[ `pwd|wc -c|tr -d ""` > 18 ]]; then echo \"\\W\"; else echo \"\\w\"; fi\`$(__git_ps1 " (%s)")]\$\[\033[0m\] "; updateWindowTitle' | |
if [ "$1" != "XDM" ] | |
then | |
mesg y | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment