How can I use mouse with panes in vim? I tried :set mouse=a but it does not seem to work when doing :sp or :vsp or vim -O

  • 1
    At least mention the terminal you're using, and whether other mouse-based applications work in there. Commented Nov 8, 2013 at 10:19
  • @IngoKarkat:xterm?I am not sure how to give you this information
    – Jim
    Commented Nov 8, 2013 at 10:30
  • Assuming you're running VIM in a terminal (and not using the GUI by running gvim or vim -g), showing the result of echo $TERM might help.
    – Useless
    Commented Nov 8, 2013 at 10:42
  • @Useless:xterm-256color. I am running vim in a terminal
    – Jim
    Commented Nov 8, 2013 at 10:53
  • 1
    Just to clarify: the mouse works normally when you use :set mouse=a, and the problem only comes when you try to work with panes, correct?
    – evilsoup
    Commented Nov 8, 2013 at 11:05

1 Answer 1


Your best bet is to download and install gvim.

If you are using Red Hat, Fedora or CentOS:

sudo yum install gvim

If you are running Ubuntu or Debian:

sudo apt-get install gvim

If you are running OpenSuse:

sudo zypper install gvim

(Run these from the terminal, of course, not from inside vim!)

If you run vim directly in xterm, rather than running gvim, then the mouse can only interact with the terminal—not with vim directly. Using vim in xterm you can select text with the mouse, but not move the cursor, and pasting text might work unpredictably, especially if you aren't in insert mode. gvim will prevent these problems.

You must log in to answer this question.

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