1

Since going to Mavericks, I've lost the ability to use the clipboard in vim when run under tmux.

I install vim via brew. For reference, yes, the +clipboard option is definitely set.

When I run vim inside a terminal directly, I can access the system clipboard normally via * and +. But when running vim inside tmux, no such luck. I also have clipboard support turned on in tmux, so perhaps this is part of the problem.

For reference:

  • vim 7.4.52
  • tmux 1.8

In my .tmux.conf:

set -g set-clipboard on

Nothing is set in my .vimrc to explicitly turn on support. However, I'll note that adding the usually recommended option (which I've never needed before):

set clipboard=unnamed

has no effect.

2 Answers 2

6

Are you running into the problem that https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard solves?

1
  • Yep, that was the problem. Somehow, despite being installed, set-option -g default-command "reattach-to-user-namespace -l zsh" had gone missing from my .tmux.conf. Commented Dec 11, 2013 at 20:56
0

I ran into this problem, although with macOS Sierra, VIM 8.0, tmux 2.3. My fix comes by way of user joshuamcginnis at https://github.com/tmux/tmux/issues/543. Make sure you have reattach-to-user-namespace:

$ brew install reattach-to-user-namespace

Then in .tmux.conf:

set -g default-shell $SHELL 
set -g default-command "tmux rename-window zsh; reattach-to-user-namespace -l ${SHELL}"

The rename-window part is optional. Otherwise new windows are named reattach-to-user-namespace.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .