Last active
December 18, 2015 15:18
-
-
Save phlco/5802943 to your computer and use it in GitHub Desktop.
updated bash profile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/tomislav/osx-terminal.app-colors-solarized | |
# Load RVM into a shell session *as a function* | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" | |
# Prefer US English and use UTF-8 | |
export LC_ALL="en_US.UTF-8" | |
export LANG="en_US" | |
# Tab improvements | |
bind 'set completion-ignore-case on' | |
bind 'set show-all-if-ambiguous on' | |
bind 'TAB: menu-complete' | |
# Aliases | |
# Clear Console | |
alias c='clear' | |
# List files in long list format including hidden files | |
alias ll='ls -la' | |
# Go back one directory | |
alias b='cd ..' | |
alias h='history' | |
alias wdi='cd ~/sites/wdi4' | |
# Exports | |
# ======= | |
# Make sublime our editor of choice | |
export EDITOR="subl -w" | |
# Make some commands not show up in history | |
export HISTIGNORE="ls:ls *:cd:cd -:pwd;exit:date:* --help" | |
# Add colors to LS | |
# http://geoff.greer.fm/lscolors/ | |
export CLICOLOR=1 | |
export LSCOLORS=fxexcxdxbxegedabagacad | |
# Git | |
# === | |
# Paste this into terminal to turn on git colors. | |
# git config --global color.ui true | |
# Fastest possible way to check if repo is dirty. | |
function parse_git_dirty() { | |
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo '*' | |
} | |
function parse_git_branch() { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" | |
} | |
# Prompt | |
# ====== | |
echo "----------------------------------------------------------------" | |
echo "$(git --version)" | |
echo "$(ruby -v)" | |
echo "$(rails -v)" | |
echo "----------------------------------------------------------------" | |
# Colors | |
BLACK='\e[0;30m' | |
BLUE='\e[0;34m' | |
GREEN='\e[0;32m' | |
CYAN='\e[0;36m' | |
RED='\e[0;31m' | |
PURPLE='\e[0;35m' | |
BROWN='\e[0;33m' | |
GRAY='\e[0;37m' | |
DARK_GRAY='\e[1;30m' | |
LIGHT_BLUE='\e[1;34m' | |
LIGHT_GREEN='\e[1;32m' | |
LIGHT_CYAN='\e[1;36m' | |
LIGHT_RED='\e[1;31m' | |
LIGHT_PURPLE='\e[1;35m' | |
YELLOW='\e[1;33m' | |
WHITE='\e[1;37m' | |
# https://dougbarton.us/Bash/Bash-prompts.html | |
PS1="\[$GREEN\]\w\[$WHITE\]\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on \")\[$LIGHT_PURPLE\]\$(parse_git_branch)\[$WHITE\]\n\$ \[$RESET\]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment