#Setting up a new Mac.
##Install via App Store
- Xcode
##Install via manual (browser) download
- iterm
- Alfred and power pack ($) (launcher, multi-clipboards)
- Dropbox
- Evernote and purchase premium ($$)
- 1Password ($$)
- Sublime Text (best GUI text editor)
- Marked 2 ($) (for rendering markdown)
- Git
- brew (preferred package installer for mac)
##Install tmux, ack, and vim
Now install tools using brew.
- tmux
- ack
- vim (CLI vim and MacVim GUI, pointing to same place)
- git-extras
$ brew update
$ brew install tmux
$ brew install ack
$ brew install git-extras$ export PATH=/usr/local/bin:$PATH
$ brew install vim && brew install macvim
$ brew link macvimIf you encounter a segmentation fault launching vim and use rvm to manage ruby versions, you will need to uninstall and reinstall using the system ruby installation.
$ brew uninstall vim; rvm system; brew install vim
##Configure the zsh and bash shells, tmux, and vim
####Shell Configure iTerm to use Solarized. Download Solarized (e.g., under ~/devtools/), unzip, and then in iTerm 'Preferences' select 'Profiles' and the 'Colors' tab, click the 'Load Presets' button, and 'import' the 'solarized/iterm2-colors-solarized/Solarized Dark.itermcolors', then make sure it is selected in iTerm.
The next step is to configure the shell, tmux, and vim. You should use whatever configuration settings you prefer. I keep my configuration files in GitHub and so the following is specific to my setup. Others are welcome to use my configuration files (fork or borrow parts).
To use zsh as your shell, install 'oh-my-zsh':
curl -L github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | shmkdir devtools && cd $_
git clone https://github.com/chasdev/config-files.git
cd ~
# if you already have a .bash_profile, .zshrc, .vimrc, or .tmux.conf, please create a backup
$ ln -s $HOME/devtools/config-files/.zshrc .zshrc
$ ln -s $HOME/devtools/config-files/.bash_profile .bash_profile
$ ln -s $HOME/devtools/config-files/.tmux.conf .tmux.conf
$ ln -s $HOME/devtools/config-files/.vimrc .vimrc
$ ln -s $HOME/devtools/config-files config-files
$ ln -s $HOME/devtools/config-files/my-snippets .vim/my-snippets####Vim
Previously I used janus, and then later pathogen to manage vim plugins. My configuration now uses Vundle which will allow other plugins to be installed simply by their inclusion in the .vimrc file.
Vim step 1: install Vundle
To use Vundle, we'll need to clone this into our .vim/bundle directory. All other plugins will be installed into the directory using Vundle, so this is the only one that needs to be done manually.
$ cd ~/.vim/bundle
$ git clone https://github.com/gmarik/Vundle.vim.gitAs discussed above, make sure '~/.vimrc' is sym linked to your local clone of this repository.
Vim step 2: install plugins
Review the plugins identified below, and remove/add plugins to the .vimrc file. For example, if you don't want support for Go (aka golang), just remove that plugin from the .vimrc file. Note that if you keep the vim-go plugin you will need to install Go (as discussed later in 'vim step 4').
When you are ready, launch vim and run:
:PluginInstall
This will install the following plugins into the ~.vim/bundle directory.
- ack
- vim-easymotion
- YouCompleteMe
- tlib (dependency for SnipMate)
- vim-addon-mv-utils (dependency for SnipMate)
- vim-snipmate
- vim-snippets (snippets used by SnipMate)
- vim-colors-solarized
- vim-fugitive
- vim-scala
- ZoomWin (Note: This is a fork, as ver 25 or better is needed which has not been pushed to the main repo.)
- vim-node
- vim-airline
- vimproc (Note: Prerequisite to Unite.vim)
- unite
- unite-tag
- vim-multiple-cursors
- Dockerfile
- vim-go
- gundo
- syntastic
- vim-commentary
- tabular (needed for vim-markdown)
- vim-markdown
- vim-repeat
- vim-surround
When this is complete, read any messages and then exit vim.
Vim step 3: Compile native extensions
Two of the plugins ('vimproc' and 'YouCompleteMe') require native extensions to be built:
$ cd ~/.vim-bundles/vimproc.vim
$ make
$ cd ~/.vim/bundle/YouCompleteMe
$ ./install.shVim step 4: Configure support for Go
You can install go using 'brew' or a package installer. Note my .zshrc expects the 'go' directory under the home directory, so if it's not either edit it or create a symlink (e.g., ln -s /usr/local/go go).
You will need to install hg (mercurial) in addition to git, as the vim-go plugin will retrieve artifacts using both hg and git and install them into the GOPATH location. To install mercurial, you can use a package installer. (Previously 'hg' was available via 'brew', so you may want to check that is supported.)
Lastly, you will need to set the $GOPATH environment variable. The zsh-custom/custom.zsh file sets GOPATH to '$HOME/working/gopath-default', so either create this directory or change the GOPATH environment variable.
##Install mitmproxy (to intercept and modify HTTP traffic)
Installation instructions: http://mitmproxy.org/doc/install.html. Also install a fast proxy switcher such as the 'SwitchySharp' chrome extension.
To start mitmproxy on port 8888 use:
mitmproxy -p 8888
##Install nvm and Node.js
Use nvm to manage (potentially) multiple Node.js installations, akin to using gvm to manage multiple groovy and grails installations.
$ git clone git://github.com/creationix/nvm.git ~/.nvm
$ . ~/.nvm/nvm.sh
$ nvm ls-remote
$ nvm install 0.11.12
At the time of this writing in order to get 0.11.x which supports important Harmony features like 'generators'. If you don't use nvm, you'll need to download the installer from the blog page. (This is because odd release versions are 'unstable'.)
Install some global node packages.
- 'node-inspector' - allows debugging the server-side JavaScript within the Chrome Developer Tools graphical debugger.
- 'express-generator' - provides an executable t
$ npm install -g node-inspector
$ npm install -g express-generator
##Install the JVM and Supporting Tools and Languages
From iTerm, try 'java -version'. This will bring up a popup with a link to download the JDK which you should then install.
Next, install gvm which we'll use to install and manage Groovy, Grails, Gradle, vert.x
$ curl -s get.gvmtool.net | bash
# Assuming the .bash_profile has been sym linked per above,
# type: sbp (aka source bash profile)
sbp
# Otherwise, you'll need to
$ source "$HOME/.gvm/bin/gvm-init.sh"
#
$ gvm install groovy
$ gvm install grails
$ gvm install gradle
$ gvm install vertx##Install Typesafe Activator (Play framework, Scala, Akka)
Download the Typesafe Activator from here.
##Install an IDE
While I do not use an IDE for day-to-day development, occasionally it's nice to have the debugging capabilities.
##Install Local Databases
brew update
brew install couchdb
brew install mongodb
brew install redis
brew install mariadb
See Installing MariaDB on Mac OS X using Homebrew
Install 'brew cask to provide a simple brew interface for installing many packaged applications for OS X.
brew tap phinze/homebrew-cask
brew install brew-cask
You can see a listing of available packaged applications using:
brew cask search
Install virtualbox and vagrant, which we can use to manage our VMs. (Note alternatively that VMWare Fusion may be used. Note: If you want to run an Oracle RDBMS locally, you'll need to install it within a VM since Oracle does not provide direct support for OS X.
brew cask install virtualbox
brew cask install vagrant
'docker' may be used to manage 'lightweight containers' running within a Virtualbox VM.
Since docker requires a linux host, I run docker within an ubuntu VM (using vagrant). Alternatively, you could use 'boot2docker' or the Vagrant 'docker provider'
A Dockerfile for the zsh-vim-tmux development environment established above is available here: https://github.com/chasdev/dev-env (albeit it is subject to changes).
(TODO: Add section regarding installation of the Oracle RDBMS on a VM as well as sqlplus on OS X.)