Note: I'm using Mac OS X Lion (10.7.5)
All links, commands and order to install
- Download Xcode
- Open Xcode, Xcode (menu) > Preferences... > Downloads. Install Command Line Tools
- Install Homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh
- Download Heroku Toolbelt
- Git config
git config --global user.email "my@email.com"
git config --global user.name "my name"
git config --global color.ui auto
git config --global help.autocorrect 1
git config --global core.editor /usr/bin/vim
git config --global core.excludesfile ~/.gitignore_global
brew install git
brew install rbenv
brew install ruby-build
rbenv install 2.1.1
rbenv global 2.1.1
brew install ctags
brew install macvim
git clone git://github.com/akitaonrails/vimfiles.git ~/.vim
cd ~/.vim
git submodule update --init
echo "source ~/.vim/vimrc" > ~/.vimrc
echo "source ~/.vim/gvimrc" > ~/.gvimrc
git submodule foreach git pull origin master
cd ~/
mkdir Code
touch .gitignore_global
brew install openssl
sudo gem install bundler
sudo gem install rails
- Download Postgres.app
- On Postgres.app icon, disable Open Documentation at Start
sudo gem install awesome_print
sudo gem install pry
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
# Comment this out to disable bi-weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"
# Uncomment to change how often before auto-updates occur? (in days)
# export UPDATE_ZSH_DAYS=13
# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"
# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment following line if you want to disable command autocorrection
# DISABLE_CORRECTION="true"
# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_WAITING_DOTS="true"
# Uncomment following line if you want to disable marking untracked files under
# VCS as dirty. This makes repository status check for large repositories much,
# much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git heroku)
source $ZSH/oh-my-zsh.sh
alias quem_foi_o_filho_da_puta="git blame"
alias start="bundle exec rake db:drop db:create db:migrate db:seed db:test:prepare db:test:load && rails s"
alias rdbr="bundle exec rake db:migrate; start"
# Customize to your needs...
# export PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
export PATH=/usr/local/bin:/usr/bin:$PATH:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/git/bin
eval "$(rbenv init -)"
function update-vim(){
local back_directory=$PWD
echo -e "\e[32mStarting to update vim plugins!\033[0m"
echo -e "\e[32mYou are in $back_directory and will back after update all plugins\033[0m"
echo -e "\e[32mNow changing directory to $HOME/.vim and starting update plugins\033[0m"
echo -e "\e[32m---------------------------------\033[0m\n"
cd ~/.vim
git pull origin master $1
git submodule foreach git pull origin master $1
echo -e "\e[32m\n---------------------------------\033[0m\n"
echo -e "\e[32mDone! All plugins are updated\033[0m"
echo -e "\e[32mNow changing back for $back_directory\033[0m"
cd $back_directory
}
function update-dev(){
local this_directory=$PWD
echo -e "\e[32m\n-----------------------------------------------\033[0m"
echo -e "\e[32m| Starting to update rails development env |\033[0m"
echo -e "\e[32m-----------------------------------------------\033[0m"
echo -e "\e[32m| This operation may take a while |\033[0m"
echo -e "\e[32m| Take a coffee :) |\033[0m"
echo -e "\e[32m-----------------------------------------------\033[0m\n\n"
echo -e "\e[32mYou are in $this_directory. And will back here\033[0m"
echo -e "\e[32m---------------------------------\033[0m"
echo -e "\e[32mUpdating oh-my-zsh\033[0m"
cd $ZSH
git pull origin master -q
echo -e "\e[32mZSH updated\033[0m"
echo -e "\e[32m---------------------------------\033[0m"
echo -e "\e[32mRunning gem update --system\033[0m"
sudo gem update --system
echo -e "\e[32m---------------------------------\033[0m"
echo -e "\e[32mRunning brew update & upgrade\033[0m"
brew update && brew upgrade --all
echo -e "\e[32m---------------------------------\033[0m"
echo -e "\e[32mRunning brew doctor\033[0m"
brew doctor
echo -e "\e[32mBrew updated\033[0m"
echo -e "\e[32m---------------------------------\033[0m"
echo -e "\e[32mNow will update vim plugins\033[0m"
cd $this_directory
update-vim -q
echo -e "\e[32m---------------------------------\033[0m"
echo -e "\e[32mNow will cleanup the gems\033[0m"
gem cleanup
echo -e "\e[32m---------------------------------\033[0m"
echo -e "\e[32mNow you are back to $this_directory and can work :D\033[0m"
}
function clear-swp(){
# find . -regex ".*\.s[abcdefghijklmnopqrstuv][a-z]" -type f
# find . -regex ".*\.s[abcdefghijklmnopqrstuv][a-z]" -type f -delete
find . -regex ".*\.sw[abcdeghijklmnop]" -type f
# find . -regex ".*\.sw[abcdeghijklmnop]" -type f -delete
}
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Logs and databases #
######################
*.log
*.sql
*.sqlite
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
# Vim files
# not ignore .swf and .swz files (flash)
*.s[a-v][a-z]
*.sw[a-e]
*.sw[g-y]
*.un~
Session.vim
.netrwhist
*~
# rbenv
.ruby-version
Replace this
if has("gui_gnome")
set term=gnome-256color
colorscheme molokai
set guifont=Monospace\ Bold\ 12
endif
if has("gui_mac") || has("gui_macvim")
set guifont=Menlo:h12
set transparency=7
endif
if has("gui_win32") || has("gui_win32s")
set guifont=Consolas:h12
set enc=utf-8
endif
with
if has("gui_gnome")
set term=gnome-256color
colorscheme molokai
set guifont=Monospace\ Bold\ 18
endif
if has("gui_mac") || has("gui_macvim")
set guifont=Menlo:h18
set transparency=7
endif
if has("gui_win32") || has("gui_win32s")
set guifont=Consolas:h18
set enc=utf-8
endif
Add (end of file)
set encoding=utf-8
set relativenumber
require 'irb/completion'
require "awesome_print"
AwesomePrint.irb!
require "awesome_print"
AwesomePrint.pry!
[color]
ui = auto
editor = /usr/bin/vim
interactive = auto
[user]
name = My Name
email = my@email.com
[core]
excludesfile = /Users/myusername/.gitignore_global
# [color "diff"]
# old = red reverse
# new = green reverse
[alias]
d = diff --color-words
report = "log --author=Name --since='2 sunday ago' --until='1 sunday ago' --format='\"%ci\",\"%s\"' --no-merges"
That's all folks