Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
96 lines (82 sloc) 2.5 KB
#homebrew settings
PATH="/usr/local/bin:/usr/local/sbin:$PATH:~/bin"
#git bash completion
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
#git stuff
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWSTASHSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
#git ps1 extension
PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[34m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ '
# some more ls aliases
alias ls="ls -G" #color ls
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
#for dotfiles management
alias dotfiles='git --git-dir=.dotfiles.git --work-tree=.'
#Node.js ndm
NODE_PATH="/usr/local/lib/node:/usr/local/lib/node_modules"
PATH="$PATH:/usr/local/share/npm/bin"
#java
function setjdk() {
if [ $# -ne 0 ]; then
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'
if [ -n "${JAVA_HOME+x}" ]; then
removeFromPath $JAVA_HOME
fi
export JAVA_HOME=`/usr/libexec/java_home -v $@`
export PATH=$JAVA_HOME/bin:$PATH
fi
}
function removeFromPath() {
export PATH=$(echo $PATH | sed -E -e "s;:$1;;" -e "s;$1:?;;")
}
setjdk 1.8
#android
export ANDROID_HOME=/Library/Android
# android tools to path
PATH="$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools"
###-begin-pm2-completion-###
### credits to npm for the completion file model
#
# Installation: pm2 completion >> ~/.bashrc (or ~/.zshrc)
#
COMP_WORDBREAKS=${COMP_WORDBREAKS/=/}
COMP_WORDBREAKS=${COMP_WORDBREAKS/@/}
export COMP_WORDBREAKS
if type complete &>/dev/null; then
_pm2_completion () {
local si="$IFS"
IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \
COMP_LINE="$COMP_LINE" \
COMP_POINT="$COMP_POINT" \
pm2 completion -- "${COMP_WORDS[@]}" \
2>/dev/null)) || return $?
IFS="$si"
}
complete -o default -F _pm2_completion pm2
elif type compctl &>/dev/null; then
_pm2_completion () {
local cword line point words si
read -Ac words
read -cn cword
let cword-=1
read -l line
read -ln point
si="$IFS"
IFS=$'\n' reply=($(COMP_CWORD="$cword" \
COMP_LINE="$line" \
COMP_POINT="$point" \
pm2 completion -- "${words[@]}" \
2>/dev/null)) || return $?
IFS="$si"
}
compctl -K _pm2_completion + -f + pm2
fi
###-end-pm2-completion-###
source /usr/local/etc/bash_completion.d/password-store
### vs code
code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}