Vim compiled with +clipboard, but both + and * registers are unable to store yanks

Viewed 911

I am using Vim 7.4 homebrew version on Mavericks, with +clipboard. Under both vim and MacVim, yanking into either + or * has no effect and pasting from either one produces an error E353: Nothing in register * (or +).

Steps to produce it:

  1. $ vim -u None
  2. Insert some text
  3. "*yy
  4. "*p => E353: Nothing in register *
  5. :echo has("clipboard") => 1

This also means that both set clipboard=unnamed and set clipboard=unnamedplus cannot properly copy & paste. Can anyone suggest how I can troubleshoot this problem?

Thanks!

Related questions:

3 Answers

Do you use tmux? tmux seems to have broken pasteboard and MacVim started from inside tmux cannot access the pasteboard. Refer to: stackoverflow.com/questions/16618992/cant-paste-into-macvim, hynek.me/articles/macvim-and-the-clipboard – Lie Ryan

You are right. The solution to this is to install reattach-to-user-namespace from homebrew and start MacVim with $ reattach-to-user-namespace mvim. Thank you! – koo

By default my tmux config tries to launch zsh with reattach-to-user-namespace zsh -l, but on my new system reattach-to-user-namespace is not yet installed and caused my confusion. – koo

Related