"No mouse support: mouse=a" error in vim

4

1

I am running a particular script and getting the following error :

  Error detected while processing /home/subhrcho/.vimrc:
  line   42:
   E538: No mouse support: mouse=a

This is the relevant portion of .vimrc file :

" In an xterm the mouse should work quite well, thus enable it.
 set mouse=a

Any idea as to what is wrong ?

P.S: I am using the following version of vim

VIM - Vi IMproved 7.0 (2006 May 7, compiled Nov 12 2010 05:24:19) Included patches: 1, 3-4, 7-9, 11, 13-17, 19-26, 29-31, 34-44, 47, 50-56, 58-64, 66-73, 75, 77-92, 94-107, 109, 202, 234-237

And my platform is :

Red Hat Enterprise Linux Server release 5.8 (Tikanga)

Geek

Posted 2013-01-29T07:26:47.053

Reputation: 1 251

1Your Vim version is ancient (2006!!!). Go grab a recent package; you'll thank me later ;-) – Ingo Karkat – 2013-01-29T10:22:36.990

Answers

9

Alternatively, you could do this in your .vimrc:

if has('mouse')
  set mouse=a
endif

And the warning/error goes away...

scooter me fecit

Posted 2013-01-29T07:26:47.053

Reputation: 191

2

Looking up the error (:help E538) brings you to the help for the 'mouse' setting:

Only works for certain terminals (xterm, MS-DOS, Win32, QNX pterm, BSD console with sysmouse and Linux console with gpm).

Also, check whether your Vim (you didn't state neither platform nor version) is compiled with mouse support:

:echo has('mouse')

If it is, it's due to the terminal; use another. If it isn't, you first need to find or compile a Vim binary that has mouse support.

Ingo Karkat

Posted 2013-01-29T07:26:47.053

Reputation: 19 513

Will I have to execute the :echo has('mouse') command from inside vim?When i executed this from vim , I got 1 . What does it mean ? – Geek – 2013-01-29T09:34:48.713

Please see the question for version and platform – Geek – 2013-01-29T09:51:35.007

Which terminal do you use? xterm? gnome-terminal? It should work in those. – Ingo Karkat – 2013-01-29T10:20:27.163

has(mouse) doesn't mean that the mouse works in your environment, it means that the feature is compiled in. – romainl – 2013-01-29T10:24:46.967

@IngoKarkat echo $TERM gives me xterm – Geek – 2013-01-29T10:43:53.347

Well, $TERM is not authoritative; it can be set by anything, and xterm is the generic value. What does the shortcut for your terminal actually launch? What does it's Help > About dialog say? – Ingo Karkat – 2013-01-29T11:18:09.387

@Ingo I see . Help-->About says "GNOME Terminal 2.16.0" – Geek – 2013-01-29T12:25:00.270

Hm, that should work. Could you try with a newer Vim version (7.3)?! – Ingo Karkat – 2013-01-29T12:48:34.357

0

I ran into this same problem and realized that only "vim-minimal" RPM was installed.

I installed vim-enhanced and suddenly "set mouse=a" works like a charm.

Bruce Greer

Posted 2013-01-29T07:26:47.053

Reputation: 1