I certainly know it's possible to make the mouse work in Vim on a remote session to a Linux machine from my Mac, but I haven't figured out just how.

Daily vim gives a tip on making it work but if I try to set 'mac-ansi', for example, I get an error saying I can only specify values beginning with builtin_ (riscos, beos-ansi, etc). I've tried using ssh -X, combined with set mouse=a and set term=builtin_anso for example, but with no success with or without combining them.

I'm using Snow Leopard and attempting to use the mouse on a Debian machine with vim 7.1.314. I've had a look at the documentation but can't make it work. Any tips?

  • The advice on that daily vim post is flat out wrong when it comes to the 'term' option. There are very few circumstances where one should be changing that option in Vim instead of making the terminal set the correct value for $TERM. Spectral's comment is right.
    – jamessan
    Mar 31, 2010 at 19:13

4 Answers 4


I don't think that Terminal.app supports xterm mouse reporting which is needed to make the mouse work. There are a few options to getting a terminal with mouse reporting functionality.

  • iTerm is an alternative terminal program that support mouse reporting
  • MouseTerm is a hack to add mouse reporting to Terminal.app but I've not tried it and don't know how well it works
  • You can also install X11 and use a real xterm

Once you've got one of those going, :set mouse=a (you might also need to :set term=xterm) and you should be in business.

  • 1
    MouseTerm solved the problem. They currently support mouse clicks and scroll events. I just installed SIMBL + MouseTerm and ran set mouse=a in Vim on my remote machine, and it worked. Jun 13, 2011 at 21:02
  • 1
    +1 for :set mouse=a in vim. With Putty running on Windows no other configuration is necessary. I can't believe I've been using keyboard only for so long. Feb 26, 2015 at 17:55

To use Terminal.app with a mouse you need to use Alt-click instead of click.
For example, in vim set mouse=a then use Alt-click to position the cursor.

This works through ssh, although it doesn't allow resizing of (vim) windows. You also lose the ability to cut from other windows and paste into the terminal window.


I don't have the answer, but I can share what I have learned in my months long search for the answer. I'm a heavy user of vim and GNU screen over ssh. Somewhat ironically, I swear by those programs because I can use them remotely without a mouse, but I have nearly abandoned OS X because it doesn't provide an easy way for me to use them remotely with a mouse.

Anyhow, here is what I have turned up:

  • xterm running under X11.app can be made to report mouse events and work as desired. Unfortunately, xterm lacks many of iTerm and Terminal.app's features. Doing something as simple changing the font in xterm requires a bit of black magic.
  • iTerm can supposedly accommodate the desired functionality, but I have never gotten it to work. iTerm also suffered from major performance issues when I jumped ship to Terminal.app a couple months ago. Screen updates happened slowly, and it would take up 25% CPU just sitting there doing nothing.
  • I actually tried using a stripped down Ubuntu VM running under VMWare as my terminal app. I set it up to boot into a fullscreen Gnome-Terminal with fluxbox as the window manager. I gave up on that solution because it didn't play nice with Spaces and the overhead of running VMWare.

Now I just never stray far from a real Linux box occasionally use vim through Terminal.app to keep me honest - if I can't remember the navigation keystrokes, I might as well be using Visual Studio.


On top of Geoff's answer, here's another possible solution:

MacVim + NetRW for vim.

MacVim has built in mouse support, and NetRW is a vim module that allows remote editing using vim scp://host/path/to/file. So just start MacVim and connect to the file, edit it and save it remotely.

You may also be interested in tweaking the GUI a bit, see my related question on SO.

You must log in to answer this question.

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