-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.bash_profile
119 lines (104 loc) · 2.8 KB
/
.bash_profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#
# COREH'S BASH PROFILE
#
# Settings
## General Settings
export EDITOR="vim"
export CC=clang
export CLICOLOR=1
export LSCOLORS=exfxxxxxcxxxxxxxxxEeEx
## Bash Settings
set -o vi
# Bash Plugins
source $(brew --prefix)/etc/bash_completion
source ~/.z.sh
source ~/.git-completion.bash
# Prompt String (PS1)
function git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \(\1\)/'
}
function prompt {
local BLACK="\[\033[0;30m\]"
local BLACKBOLD="\[\033[1;30m\]"
local RED="\[\033[0;31m\]"
local REDBOLD="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local GREENBOLD="\[\033[1;32m\]"
local YELLOW="\[\033[0;33m\]"
local YELLOWBOLD="\[\033[1;33m\]"
local BLUE="\[\033[0;34m\]"
local BLUEBOLD="\[\033[1;34m\]"
local PURPLE="\[\033[0;35m\]"
local PURPLEBOLD="\[\033[1;35m\]"
local CYAN="\[\033[0;36m\]"
local CYANBOLD="\[\033[1;36m\]"
local WHITE="\[\033[0;37m\]"
local WHITEBOLD="\[\033[1;37m\]"
local DEFAULT="\[\033[00m\]"
export PS1="$WHITEBOLD\w$GREEN\$(git_branch)$DEFAULT \$ "
}
prompt
# Aliases
## Misc Commands
alias m="mate"
alias s="subl"
alias v="vim"
alias f="fg"
alias ll='ls -l'
alias less='less -R'
alias rm!="rm -rf"
alias md="mkdir"
## Vim-like Commands
alias :e="vim"
alias :q="exit"
## NPM
alias ni='npm install'
alias nig='npm install --global'
## Burl
alias GET='burl GET'
alias HEAD='burl -I'
alias POST='burl POST'
alias PUT='burl PUT'
alias PATCH='burl PATCH'
alias DELETE='burl DELETE'
alias DEL='burl DELETE'
alias OPTIONS='burl OPTIONS'
## Git
alias g="git"
alias gd="git diff"
alias gds="git diff --staged"
alias ga="git add"
alias gst="git status"
alias gc="git commit"
alias gcm="git commit -m"
alias gca="git commit -a"
alias gcam="git commit -a -m"
alias gm="git merge --no-ff"
alias gpt="git push --tags"
alias gp="git push"
alias grh="git reset --hard"
alias gb="git branch"
alias gcob="git checkout -b"
alias gco="git checkout"
alias gba="git branch -a"
alias gcp="git cherry-pick"
alias gl="git lol"
alias gpom="git pull origin master"
alias gpoh="git push origin HEAD"
alias gcd='cd "`git rev-parse --show-toplevel`"'
alias gsu='git submodule update'
## Frequently Edited Files
alias hosts="sudo $EDITOR /etc/hosts"
alias profile="$EDITOR ~/.bash_profile"
alias vimrc="$EDITOR ~/.vimrc"
## Frequently Used Commands
alias proxy="ssh -N -D 8080 proxy"
alias cloudup="/Applications/Cloudup.app/Contents/MacOS/Cloudup"
alias cloudup-dev="CLOUDUP_ENV=dev NODE_ENV=development cloudup"
alias cloudup-stage="CLOUDUP_ENV=stage cloudup"
## Uncolor Colored Output
alias uncolor="perl -pe 's/\e\[?.*?[\@-~]//g'"
# Disable Tilde Expansion, Very Annoying
function _expand() { :;}
# Display a random man page title upon start
# dir="/usr/bin"; man $(ls $dir |sed -n "$(echo $(( $RANDOM % $(ls $dir |wc -l | awk "{ print $1; }" ) + 1 )) )p") | head -n 6 | tail -n 2