Skip to content

Instantly share code, notes, and snippets.

@roderik
Created November 10, 2010 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roderik/670638 to your computer and use it in GitHub Desktop.
Save roderik/670638 to your computer and use it in GitHub Desktop.
OSX bashrc file for kDeploy install
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
return
fi
## editor
if [ -f /usr/local/bin/mate ]; then
export EDITOR='mate'
export GIT_EDITOR='mate -wl1'
fi
if [ -f /usr/local/bin/subl ]; then
export EDITOR='subl -w'
fi
## history control
export HISTCONTROL=ignoreboth
shopt -s histappend
shopt -s checkwinsize
shopt -s hostcomplete
## fix psycopg2 on 10.7.3
export PGHOST=/tmp
## path
for another_bin in \
$HOME/bin/extras \
/usr/local/php5/bin
do
[[ -e $another_bin ]] && export PATH=$another_bin:$PATH
done
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
## rvm
if [ -f $HOME/.rvm/scripts/rvm ]; then
export rvm_path=$HOME/.rvm/
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
fi
# no ._ files in archives please
export COPYFILE_DISABLE=true
## aliasses
# Open a manpage in Preview, which can be saved to PDF
function pman {
man -t "${1}" | open -f -a /Applications/Preview.app
}
alias man="pman"
alias psqlstop='pg_ctl -D /usr/local/var/postgres stop -s -m fast'
alias psqlstart='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start'
alias mysqlstart='mysql.server start'
alias mysqlstop='mysql.server stop'
alias startall='psqlstart;mysqlstart'
alias stopall='psqlstop;mysqlstop'
alias flushdns="dscacheutil -flushcache"
alias kd="cd /opt/kDeploy/tools"
## tab completions
set completion-ignore-case On
if [ -f /usr/local/etc/bash_completion ]; then
. /usr/local/etc/bash_completion
fi
## prompt
RED="\[\033[0;31m\]"
PINK="\[\033[1;31m\]"
YELLOW="\[\033[1;33m\]"
LT_YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
LT_GREEN="\[\033[1;32m\]"
BLUE="\[\033[0;34m\]"
WHITE="\[\033[1;37m\]"
PURPLE="\[\033[1;35m\]"
CYAN="\[\033[1;36m\]"
COLOR_NONE="\[\033[0m\]"
function set_prompt {
if [[ ${EUID} == 0 ]] ; then
PS1="[\t]${LT_YELLOW}[${COLOR_NONE}${CYAN}\u@\h${COLOR_NONE} ${RED}\w${COLOR_NONE}${LT_YELLOW}]${COLOR_NONE}${BLUE}$(__git_ps1 "(%s)")${COLOR_NONE}\$ "
else
PS1="[\t]${LT_YELLOW}[${COLOR_NONE}${CYAN}\u@\h${COLOR_NONE} ${GREEN}\w${COLOR_NONE}${LT_YELLOW}]${COLOR_NONE}${BLUE}$(__git_ps1 "(%s)")${COLOR_NONE}\$ "
fi
}
# Tell the terminal about the working directory at each prompt.
PROMPT_COMMAND="set_prompt"
if [ "$TERM_PROGRAM" == "Apple_Terminal" ] && [ -z "$INSIDE_EMACS" ]; then
update_terminal_cwd() {
# Identify the directory using a "file:" scheme URL,
# including the host name to disambiguate local vs.
# remote connections. Percent-escape spaces.
local SEARCH=' '
local REPLACE='%20'
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
printf '\e]7;%s\a' "$PWD_URL"
}
PROMPT_COMMAND="update_terminal_cwd; set_prompt"
fi
## env settings
export CLICOLOR=1
export LSCOLORS=gxfxcxdxbxegedabagacad
export TZ='Europe/Brussels'
export LC_ALL=en_US.UTF-8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment