I ran into this issue on a mid-2017 Macbook Pro running vim
within iTerm2
as my primary development environment.
As other answers have suggested, I ran vim --version
and noticed that it returns -clipboard
, which means that the version of vim
that shipped with my machine hasn't been compiled with the clipboard option.
The homebrew
package for vim
appears to compile with the clipboard
option, so the fix for me was to:
- Run
brew install vim
- Add
set clipboard+=unnamed
to my~/.vimrc
file - Close and reopen
iTerm2