Skip to content

Instantly share code, notes, and snippets.

@jeffrafter
Created February 4, 2013 17:21
Show Gist options
  • Save jeffrafter/4708128 to your computer and use it in GitHub Desktop.
Save jeffrafter/4708128 to your computer and use it in GitHub Desktop.
Basic Bash
export HISTCONTROL=ignoredups
export INPUTRC="~/.inputrc"
export EDITOR='open -a /Applications/MacVim.app -f'
shopt -s checkwinsize
shopt -s cdspell
shopt -s histappend
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
alias ls='ls -GpF'
alias ll='ls -l -a'
alias mvim='open -a /Applications/MacVim.app'
alias vim='open -a /Applications/MacVim.app'
alias netcat='nc'
alias top='echo "Use the [o] key to change the order, with the flag [pid] or [vsize] (press any key)" && read && top -o cpu'
alias modify="awk '{field = \$NF}; END {print field}' | xargs open -a /Applications/MacVim.app"
alias gitx="open -a /Applications/GitX.app"
alias guard="bundle exec guard"
alias git=hub
alias it=git
source /usr/local/git/contrib/completion/git-completion.bash
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
if [ -f `brew --prefix`/etc/autojump ]; then
. `brew --prefix`/etc/autojump
fi
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
source ~/.bash_colors
PROMPT_COMMAND='history -a;echo -ne "\033]0;${PWD}\007";'
export PS1='\[\033[7;4;39m\]\u\[\033[1;4;38m\]@\[\033[2;4;38m\]\h\[\033[0;27m\]:\[\033[4;30m\]\w\e[0;37m$(__git_ps1 " [%s]")\n\[\033[0;37m\]$\[\033[0m\] '
case $TERM in
xterm* | aterm | rxvt | screen )
XTITLE="\[\e]0;\u@\h (\w)\a\]" ;;
* )
XTITLE="" ;;
esac
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
#ps ${SSH_AGENT_PID} doesn't work under cywgin
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment