Skip to content

Instantly share code, notes, and snippets.

@CharlieCrisp
Last active March 12, 2018 20:53
Show Gist options
  • Select an option

  • Save CharlieCrisp/b1ad3f4181cf43f2e492c44ee55ebeb5 to your computer and use it in GitHub Desktop.

Select an option

Save CharlieCrisp/b1ad3f4181cf43f2e492c44ee55ebeb5 to your computer and use it in GitHub Desktop.
bash_profile
alias gg='git log --oneline --graph'
alias gco='git checkout'
alias gs='git status'
# OPAM configuration
. /Users/charlie/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# colors
PS1="\[\033[94m\]\u:\\[\033[33;39m\]\w\[\033[m\]\[\033[32m\]\$(parse_git_branch)\[\033[00m\]\nλ "
# Tell ls to be colourful
export CLICOLOR=1
export LSCOLORS=Exfxcxdxbxegedabagacad
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
if [[ "$TERM" != "screen" ]] ; then
# Attempt to discover a detached session and attach
# it, else create a new session
WHOAMI=$(whoami)
if tmux has-session -t $WHOAMI 2>/dev/null; then
tmux -2 attach-session -t $WHOAMI
else
tmux -2 new-session -s $WHOAMI
fi
else
# One might want to do other things in this case,
# here I print my motd, but only on servers where
# one exists
# If inside tmux session then print MOTD
MOTD=/etc/motd.tcl
if [ -f $MOTD ]; then
$MOTD
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment