Skip to content

Commit

Permalink
update bash_profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke F Wilson committed Nov 18, 2014
1 parent f10f8f0 commit 4059570
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 33 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
33 changes: 0 additions & 33 deletions .profile

This file was deleted.

57 changes: 57 additions & 0 deletions bash_profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# add ~/bin to PATH
export PATH=~/bin:$PATH

# cOloRs FOr DaH prOmPt!!!!11!!!1
c_purple='\[\e[0;35m\]'
c_cyan='\[\e[0;36m\]'
c_green_bold='\[\e[1;32m\]'
c_red_bold='\[\e[1;31m\]'
c_reset='\[\e[0m\]'

# git auto completion
if [ -f ~/profile/.git-completion.bash ]; then
. ~/profile/git-completion.bash
fi

# to show git branch in prompt -- may not need it
# source ~/profile/git-prompt.sh

source ~/profile/short-working-directory.sh

colored_time() {
status_color=$?

if [[ "$status_color" != "0" ]]; then
status_color="${c_red_bold}"
else
status_color="${c_green_bold}"
fi

echo "$status_color\t${c_reset}"
}

# determines if the git branch you are on is clean or dirty
git_prompt () {
if ! git rev-parse --git-dir > /dev/null 2>&1; then
return 0
fi

git_branch=$(Git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')

if git diff --quiet 2>/dev/null >&2; then
git_start="("
git_end=")"
else
git_start="{"
git_end="}"
fi

echo " $git_start$git_branch$git_end"
}


PROMPT_COMMAND='PS1="$(colored_time)⚡ \u${c_cyan} $(shorten_path "\w" 20)${c_purple}\$(git_prompt)${c_reset} > "'

# always show ls with colors, including hidden, and humanized size
export LSCOLORS=GxBxhxDxdxxahadadaeaea
alias ls='ls -Gha'

0 comments on commit 4059570

Please sign in to comment.