Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The Story

I'm using vim on a Ubuntu server to develop a webpage. Most of the time I work from a Windows machine using putty. Whenever I have to copy something from vim to the Windows clipboard I just select it while holding shift (shift is necessary when using set mouse=a in .vimrc).

The Problem

Sometimes I have to use an OSX machine. Well, no problem: Using the OSX terminal I ssh to my Ubuntu server and vim as I do using putty. The problem is: As soon as I set mouse=a it is no longer possible to easily copy content to the OSX clipboard. As long as mousa=a is not set, I can just copy content by selecting it.

The Request

Does anyone know how to easily copy something from vim to the OSX clipboard if the "set mouse=a" line is in .vimrc?

Thank you.


The Solution

in .vimrc

set mouse=a
set term=xterm

Then it is possible to copy from vim in iTerm if I press "Alt" while selecting the content I want to copy.

share|improve this question

migrated from Oct 5 '11 at 11:03

This question came from our site for professional and enthusiast programmers.

Take a look at… – kirbuchi Oct 5 '11 at 7:02
Maybe I'm doing it wrong, but that does not work in my case. I've also tried that before. – SirSiggi Oct 5 '11 at 7:20

Select the text you want, then hit Ctrl-insert to copy and Shift-insert to paste.

share|improve this answer
No modern Macintosh keyboard includes an Insert key... – mitjak Aug 16 '12 at 20:09

Do you copy using mouse selection then CmdC?

Doing that in plain vanilla works as intended here with more or less the same setup (running Vim with set mouse=a on a Ubuntu server via SSH in on MacOS X 10.6.7).

But I have installed MouseTerm some months ago and the copy using mouse selection then CmdC business doesn't work when it's activated. As soon as I uncheck the "Left Click" box, copying the selected text with CmdC works.

Do you have Mouseterm installed?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.