DevNotes

Concise, Handy and Elegant Notes for Developers

0%

Setup develop environment on Mac

XCode

Install XCode from Apple App store, and you might need XCode Command Line Developer Tools, which is needed to build e.g. Ruby gem native extensions and install other system packages.

1
xcode-select --install

To check it after installation

1
gcc --version

HomeBrew

We need packages manager on Mac

1
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

iTerm2

iTerm2 is a replacement for the native Terminal app that ships with Mac OS X.
Download and install it. And go to iTerm 2 => Preferences => Profiles => General, check “Copy to clipboard on selection”, check themes for fancy colors, “Solarized Dark Higher Contrast” is the one I am using.

Zsh

Oh-my-zsh is the awesome Zsh framework.

Install it via curl

1
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

or via wget

1
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

and change zsh to be default:

1
chsh -s $(which zsh)

Enable plugins from .zshrc file

1
plugins=(git rails ruby gem rake bundler brew osx vagrant wd)

and choose a theme

1
ZSH_THEME="blinks"

More themes could be found from oh-my-zsh github page.

Tmux

Tmux is a terminal multiplexer, which lets you switch between several programs in one terminal and easily attach and detach session towards remote server

1
brew install tmux

and just grab someone’s config file, e.g. this one

Vim

1
brew install Vim

Might need to rehash after the latest version installed.

Configuration is time consuming, so I just take from spf13

My personal created .vimrc.bundles.local looks like:

1
2
3
4
Bundle 'Chiel92/vim-autoformat'
Bundle 'avakhov/vim-yaml'
Bundle 'jmcantrell/vim-virtualenv'
Bundle 'elixir-lang/vim-elixir'

And customized .vimrc.local

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
set shell=/bin/zsh

nnoremap gV gUiW
nnoremap gv guiW

nnoremap <C-h> ^
nnoremap <C-l> $

set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 9
set laststatus=2

noremap <F3> :Autoformat<CR>

au BufWrite * :Autoformat

let g:ackprg = 'ag --vimgrep'

and my .vimrc.before.local file is

1
2
3
let g:spf13_no_autochdir = 1
let g:spf13_bundle_groups = ['general', 'programming', 'misc', 'html', 'python', 'ruby', 'javascript', 'youcompleteme']
let g:airline_powerline_fonts = 1

Furthermore, your might need the silver searcher to speedup your searching.

And if you get a warning message like

1
"ycm_client_support.[so|pyd|dll] and ycm_core.[so|pyd|dll] not detected; you need to compile YCM before using it."

Then just do

1
2
cd .vim/bundle/YouCompleteMe
./install.sh

should solve it!

Install Powerline

1
pip install powerline-status

Download Powerline Fonts and run ./install, then from “Profiles” => “Text” => “Font” => “Change Font”, to e.g. “Source Code Pro for Powerline”.

And you might find it’s convenient to map ESC key to CapsLock, I manage to do so using Seil.

Furthermore, Karabiner could be interesting if you want to customize your keyboard more.

To make the solarized theme work properly in terminal, it is good to download from solarized home page. Then import it form iTerm 2 => Preferences => Profiles => profiles => Colors => Load Presets… => Import…

Finally a screen shot

Enjoy! :)