Skip to content

Instantly share code, notes, and snippets.

@jkosoy
Last active October 13, 2015 02:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jkosoy/4126145 to your computer and use it in GitHub Desktop.
Save jkosoy/4126145 to your computer and use it in GitHub Desktop.
Bash Profile Settings.
alias ls='ls -GFh'
export CLICOLOR=1
# From Andrzej Szelachowski's ~/.bash_profile:
# Note that a variable may require special treatment
#+ if it will be exported.
DARKGRAY='\[\e[1;30m\]'
LIGHTRED='\[\e[1;31m\]'
GREEN='\[\e[32m\]'
YELLOW='\[\e[1;33m\]'
LIGHTBLUE='\[\e[1;34m\]'
NC='\[\e[m\]'
# PCT="\`if [[ \$EUID -eq 0 ]]; then T='$LIGHTRED' ; else T='$LIGHTBLUE'; fi;
# echo \$T \`"
# For "literal" command substitution to be assigned to a variable,
#+ use escapes and double quotes:
#+ PCT="\` ... \`" . . .
# Otherwise, the value of PCT variable is assigned only once,
#+ when the variable is exported/read from .bash_profile,
#+ and it will not change afterwards even if the user ID changes.
# PS1="\n$GREEN[\w] \n$DARKGRAY($PCT\t$DARKGRAY)-($PCT\u$DARKGRAY)-($PCT\!
# $DARKGRAY)$YELLOW-> $NC"
# Escape a variables whose value changes:
# if [[ \$EUID -eq 0 ]],
# Otherwise the value of the EUID variable will be assigned only once,
#+ as above.
# When a variable is assigned, it should be called escaped:
#+ echo \$T,
# Otherwise the value of the T variable is taken from the moment the PCT
#+ variable is exported/read from .bash_profile.
# So, in this example it would be null.
# When a variable's value contains a semicolon it should be strong quoted:
# T='$LIGHTRED',
# Otherwise, the semicolon will be interpreted as a command separator.
# Variables PCT and PS1 can be merged into a new PS1 variable:
PS1="\`if [[ \$EUID -eq 0 ]]; then PCT='$LIGHTRED';
else PCT='$YELLOW'; fi;
echo '\n$DARKGRAY-------------------------\n$GREEN\w \n$DARKGRAY'\$PCT'\t$DARKGRAY \
'\$PCT'$LIGHTBLUE\u$DARKGRAY@$LIGHTRED\h $DARKGRAY\$ $NC'\`"
# The trick is to use strong quoting for parts of old PS1 variable.
PATH=/usr/local/bin:$PATH:/usr/local/Cellar/ruby/1.9.3-p327/bin
##
# Your previous /Users/jkosoy/.bash_profile file was backed up as /Users/jkosoy/.bash_profile.macports-saved_2013-02-01_at_13:14:09
##
# MacPorts Installer addition on 2013-02-01_at_13:14:09: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/share/npm/bin:$(brew --prefix ruby)/bin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
# PHP Versions
export PATH="$(brew --prefix josegonzalez/php/php55)/bin:$PATH" # php 5.5.5 from homebrew
#export PATH="/Applications/MAMP/bin/php/php5.5.3/bin:$PATH" # or use MAMP as default PHP
# End PHP Versions
### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"
# Node modules.
export PATH="/usr/local/share/npm/lib/node_modules:$PATH"
export PATH="$VIRTUAL_ENV/bin:$PATH"
# {{{
# Node Completion - Auto-generated, do not touch.
shopt -s progcomp
for f in $(command ls ~/.node-completion); do
f="$HOME/.node-completion/$f"
test -f "$f" && . "$f"
done
# }}}
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
# The next line updates PATH for the Google Cloud SDK.
source '/Users/jkosoy/google-cloud-sdk/path.bash.inc'
# The next line enables bash completion for gcloud.
source '/Users/jkosoy/google-cloud-sdk/completion.bash.inc'
# Add AE to Python
export PYTHONPATH=/Users/jkosoy/google-cloud-sdk/platform/google_appengine/:$PYTHONPATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment