Skip to content

Instantly share code, notes, and snippets.

@gpspake
Created January 18, 2017 21:25
Show Gist options
  • Select an option

  • Save gpspake/36cb9821b1565dbca42ae5b78647604f to your computer and use it in GitHub Desktop.

Select an option

Save gpspake/36cb9821b1565dbca42ae5b78647604f to your computer and use it in GitHub Desktop.
# COLORS
export TERM=xterm-color
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
export HOMEBREW_CASK_OPTS="--appdir=/Applications"
# PATHS
export DEVELOPMENT_DIRECTORY="$HOME/development"
export DOTFILES_DIRECTORY="$HOME/dotfiles"
# ALIASES
## ll to detailed direct list
alias ll='ls -la'
#edit bash profile
alias bashedit='vim ${DOTFILES_DIRECTORY}/bash/.bash_profile'
#source bash profile after editing
alias bashsource='source ${DOTFILES_DIRECTORY}/bash/.bash_profile'
#go to dotfiles
alias dotfiles='cd ${DOTFILES_DIRECTORY}'
#go to development
alias dev='cd ${DEVELOPMENT_DIRECTORY}'
#to lower
alias tolower='for f in *; do mv "$f" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done'
## ll after cd - @speakingcode
function cd() {
new_directory="$*";
if [ $# -eq 0 ]; then
new_directory=${HOME};
fi;
builtin cd "${new_directory}" && ll
}
#mkdir and cd
function mkcd() { mkdir -p "$@" && cd "$_"; }
## "d <tab>" to autocomplete against anything in ~/Development
## http://drawingablank.me/blog/bash-alias-with-subdirectory-tabcompletion.html
function d() { cd "${DEVELOPMENT_DIRECTORY}/$1"; }
complete -C ~/.bash/development_completion -o filenames -o nospace d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment