Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: db336787f0
Fetching contributors…

Cannot retrieve contributors at this time

205 lines (168 sloc) 4.77 kB
# ~/.bashrc: executed by bash(1) for non-login shells.
function proml
{
local DEFAULT="\[\033[0m\]"
local BLACK="\[\033[0;30m\]"
local GRAY="\[\033[1;30m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
local BROWN="\[\033[0;33m\]"
local YELLOW="\[\033[1;33m\]"
local MAGENTA="\[\033[0;35m\]"
local CYAN="\[\033[0;36m\]"
local LIGHT_CYAN="\[\033[1;36m\]"
local LIGHT_GRAY="\[\033[0;37m\]"
case $TERM in
xterm*)
local TITLEBAR='\[\033]0;\w (\h)\007\]'
;;
*)
local TITLEBAR=''
;;
esac
PS1="${TITLEBAR}\
${LIGHT_GREEN}\
\\h${MAGENTA}\$(__git_ps1)${LIGHT_GREEN}% \
${DEFAULT}"
PS2='> '
PS4='+ '
}
# Colorize the Terminal
# http://www.byteengine.net/custom-colors-in-snow-leopard-terminal-64-bit
export CLICOLOR=1
# Tmux colour names
colours-for-tmux()
{
for i in {0..255} ; do
printf "\x1b[38;5;${i}mcolour${i}\n"
done
}
# If running interactively...
if [ "$PS1" ]; then
export HISTCONTROL=ignoredups
export HISTSIZE=10000
shopt -s histappend
# Set prompt and terminal title.
proml
export PS1 PS2 PS4
unset proml
PROMPT_COMMAND="history -a" # update .bash_history after every command
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc).
#if [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
#fi
fi
# Bash settings
FIGNORE=CVS:.pyc:.svn
HISTCONTROL=ignoredups
# Environment
prepend_to_path()
{
local dir="$1"
if ! echo $PATH | egrep -qs "\b$dir\b"; then
PATH="$dir:$PATH"
fi
}
append_to_path()
{
local dir="$1"
if ! echo $PATH | egrep -qs "\b$dir\b"; then
PATH="$PATH:$dir"
fi
}
prepend_to_path "/usr/local/share/python"
prepend_to_path "/usr/local/bin"
prepend_to_path "/usr/local/sbin"
append_to_path "/usr/local/Cellar/python/2.6.5/bin"
append_to_path "$HOME/bin"
[ -e "/usr/local/mysql" ] && append_to_path "/usr/local/mysql/bin"
export PATH
set_aliases()
{
alias ls="ls -F"
alias ll="ls -l"
alias lt="ls -lrt"
alias la="ls -A"
alias ssh="/usr/bin/ssh"
alias vi-code="vi -c 'set number'"
alias vi-dark="vi -c 'set background=dark' -c 'set number'"
alias vi-light="vi -c 'set background=light' -c 'set number'"
alias ppjson="python -mjson.tool"
alias mvimr="mvim --remote-silent"
which -s hub && alias git="hub"
# See
# http://akahn.net/2011/10/12/working-through-git-conflicts-in-vim.html
# Use with 'conflicts | xargs mvim'
alias conflicts="git ls-files --unmerged | cut -f2 | uniq"
}
set_aliases
bundle()
{
if [ "$1" == "open" ]; then
shift
( cd $($(which bundle) show $*) && $EDITOR . )
else
$(which bundle) $*
fi
}
with-all-rubies()
{
local cmd="$@"
local version
for version in 1.8.7 1.9.1 1.9.2; do
rvm $version
echo "## Switching to $(ruby -v)"
$cmd
done
}
export EMAIL_ADDRESS="graham@effectif.com"
export CVS_RSH="ssh"
export CVSIGNORE="*~ *.bak *.pyc *.log *.pid"
export EDITOR="vi"
export MANPATH="$MANPATH:/opt/local/man"
export RSYNC_RSH="ssh"
# Set LC_CTYPE for TextMate (see the Bundles chapter in the help)
export LC_CTYPE=en_US.UTF-8
# Command completion
complete -W "$(grep -E '^(\w)' ~/.ssh/known_hosts | awk '{ print $1 }' |
sort -u | cut -d ',' -f 1)" ssh scp rsync ping
# Functions
_listgems()
{
local curw
COMPREPLY=()
curw=${COMP_WORDS[COMP_CWORD]}
local gems="$(gem environment gemdir)/gems"
COMPREPLY=($(compgen -W '$(ls $gems)' -- $curw));
return 0
}
complete -F _listgems -o dirnames mategem
complete -F _listgems -o dirnames mvimgem
complete -F _listgems -o dirnames vimgem
if [ -f ~/.git-bash-completion.sh ]; then
source ~/.git-bash-completion.sh
fi
if ! type -t __git_ps1 >/dev/null; then
__git_ps1()
{
local b="$(git symbolic-ref HEAD 2>/dev/null)";
if [ -n "$b" ]; then
printf " (%s)" "${b##refs/heads/}";
fi
}
fi
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWSTASHSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=1
export GITHUB_USER=gma
export NODE_PATH=/usr/local/lib/node_modules
# Load external code
BASH_COMP=/usr/local/etc/bash_completion.d
[ -f $BASH_COMP/git-completion.bash ] && source $BASH_COMP/git-completion.bash
[ -f ~/.bundler-exec.sh ] && source ~/.bundler-exec.sh
[ -f ~/.nesta-completion.sh ] && source ~/.nesta-completion.sh
[ -f ~/.tmuxinator-completion.sh ] && source ~/.tmuxinator-completion.sh
[[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] && source $HOME/.tmuxinator/scripts/tmuxinator
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
Jump to Line
Something went wrong with that request. Please try again.