Add this to your Vim configuration file (.vimrc)

set clipboard=unnamed

This makes yanking work with default Terminal, but to make it work with iTerm you need to check Allow clipboard access to terminal apps in iTerm preferences.