Mac – Vim and mouse with ssh from Mac to Linux

debianmacsshvim

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?

Best Answer

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.