Skip to content

Instantly share code, notes, and snippets.

@forrestfiller
Forked from mimiflynn/.bash_profile
Created November 17, 2016 21:06
Show Gist options
  • Save forrestfiller/3677ceef4d739830f8a1afbdb925a55d to your computer and use it in GitHub Desktop.
Save forrestfiller/3677ceef4d739830f8a1afbdb925a55d to your computer and use it in GitHub Desktop.
export PATH=/usr/local/bin:/usr/local/share/npm/bin:/usr/local/opt/ruby/bin:/Applications/MAMP/bin:/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php5.3.6/bin:/Users/mimiflynn/bin:$PATH
# pip should only run in when virtualenv is currently activated
export PIP_REQUIRE_VIRTUALENV=true
# cache pip-installed packages to avoid re-downloading
export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache
alias profile='vim ~/.bash_profile'
alias rehash='source ~/.bash_profile'
alias show='defaults write com.apple.finder AppleShowAllFiles TRUE && killall Finder'
alias hide='defaults write com.apple.finder AppleShowAllFiles FALSE && killall Finder'
alias ls='ls -G'
alias gpull='git pull origin master'
alias gpush='git push origin master'
alias nodewebkit='zip -r ../${PWD##*/}.nw *'
# Path ------------------------------------------------------------
if [ -d ~/.local/bin ]; then
export PATH=~/.local/bin:$PATH
fi
# Load in .bashrc -------------------------------------------------
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
# Load prompt
if [ -f ~/.bash_prompt ]; then
source ~/.bash_prompt
fi
# Colors
TEMP="\[\033[1;30m\]"
BLACK="\[\033[0;30m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[0;32m\]"
ORANGE="\[\033[0;33m\]"
BLUE="\[\033[0;34m\]"
PURPLE="\[\033[0;35m\]"
CYAN="\[\033[0;36m\]"
LIGHT_GRAY="\[\033[0;37m\]"
LIGHT_BLACK="\[\033[1;30m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
YELLOW="\[\033[1;33m\]"
LIGHT_BLUE="\[\033[1;34m\]"
LIGHT_PINK="\[\033[1;35m\]"
LIGHT_CYAN="\[\033[1;36m\]"
WHITE="\[\033[1;37m\]"
NO_COLOUR="\[\033[0m\]"
BLUE_BG="\[\033[0;44m\]"
# Prompt
# export PS1="$LIGHT_BLUE[$CYAN\h$LIGHT_BLUE][$WHITE\w$LIGHT_BLUE]\n$LIGHT_BLUE[$WHITE\t$LIGHT_BLUE]$NO_COLOUR\$ "
export PS1="$LIGHT_BLUE[$CYAN\h$LIGHT_BLUE] [$LIGHT_RED\w$LIGHT_BLUE]\n$LIGHT_BLUE[$WHITE\d \@$LIGHT_BLUE] $NO_COLOUR\$ "

.bash_profile fun times

virtualenv quick activate bash function

# set virtual env with 'venv <env name>'
# instead of directory/structure/<env name>/bin/
venv() {
  # directory where the virtualenvs live
  VENVDIR="$HOME/Virtualenvs"
  
  ENVDIR=$VENVDIR/$1

  if [ -d "$ENVDIR" ]; then
    . "$ENVDIR"/bin/activate
  fi
  if [ ! -d "$ENVDIR" ]; then
    echo "There is no virtual environment called" $1 "in" $VENVDIR
  fi
}
" quick edit for gvimrc
map <leader>g :tabedit ~/.gvimrc.local<CR>
" When gvimrc is edited, reload it
autocmd! bufwritepost .gvimrc.local source ~/.gvimrc.local
" Appearance
set lines=50
set columns=100
set guifont=Monaco:h12
set guioptions-=T
set transparency=5
colorscheme cobaltish
" highlight current line
set cursorline
"highlight bg color of current line
hi cursorline guibg=#7F3700
hi colorcolumn guibg=#020236
" Bonus Bundles
Bundle 'git://git.wincent.com/command-t.git'
" Tab settings
set tabstop=2
set softtabstop=2
set shiftwidth=2
set smarttab
set expandtab
" Keyboard Shortcuts
let mapleader = '\'
" Let's us save with \w.
" \ is the default leader key.
map <leader>w :w!<cr>
" Fast editing of the .vimrc.local
map <leader>e :tabedit! ~/.vimrc.local<CR>
" Clear trailing whitespace with \s and save the file.
map <leader>s :%s/\s\+$//e<CR>:w!<CR>
" Fix indentation and return to current line
map <leader>i mzgg=G`z<CR>
" Open files quickly with \o.
map <leader>o :tabedit<Space>
map <leader>t :CommandT<CR>
" Open a custom Commad-T instace with \T
map <leader>T :CommandT<Space>~/Sites
" Open files verticall quickly with \v.
map <leader>v :vsplit<Space>
" Better tab functionality.
map <leader>[ :tabprev<CR>
map <leader>] :tabnext<CR>
map <leader>- :tabfirst<CR>
map <leader>= :tablast<CR>
" Toggle paste mode with \p
set pastetoggle=<leader>p
" Toggle line numbers with \n
nmap <leader>n :set invnumber<CR>
map <space> /
map <c-space> ?
" Other Customization
set wrap
set linebreak
set nolist
set mouse=a
colorscheme ir_black
" When vimrc is edited, reload it
autocmd! bufwritepost .vimrc.local source ~/.vimrc.local
" Column at line 80
if version >= 703
set colorcolumn=81,82
endif
"highlight bg color of current line
hi cursorline ctermbg=black
hi colorcolumn ctermbg=234
let g:CommandTAcceptSelectionMap = '<C-t>'
let g:CommandTAcceptSelectionTabMap = '<CR>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment