vim says "No mouse support", but only when I run git commit

git, vim

Solution

Does `vim` on Appa otherwise behave correctly? That is, do you have the problem whenever you run `vim`, or only when using `git commit`?

If the former:

Are you sure that `git commit` is running `vim`? Many applications default to using `vi` in the absence of any other configuration, and it's typical for `vi` to either (a) a very minimal version of `vim` missing lots of fancy features or (b) something completely different.

Try explicitly setting `core.editor` to `vim` and see what happens:

git config --global core.editor vim

Alternatively, you can also set your `EDITOR` and `VISUAL` environment variables.

Problem

I like using the mouse with vim, so I have mouse support enabled in my `.vimrc`. This works just fine most everywhere, but whenever I run `git commit` on a specific server (Appa), I get an error message: ``` [tswett@appa git]$ git commit Error detected while processing /home/tswett/.vimrc: line 1: E538: No mouse support: mouse=a Press ENTER or type command to continue Aborting commit due to empty commit message. [tswett@appa git]$ ``` I end up with a vim session that has no mouse support and no syntax highlighting. If I run `git commit` on a different server, or on my local machine, I do have mouse support and syntax highlighting. Likewise, whenever I use vim to edit anything else on Appa, I have mouse support and syntax highlighting. If I remove the `set mouse=a` line from `.vimrc` and then run `git commit` on Appa, I no longer get an error message, but I also don't get syntax highlighting, either. How can I get vim, `git commit`, and Appa to all play nice with each other? Appa's operating system is RHEL 6.3 (Santiago); Appa's vim is version 7.2; and Appa's git is version 1.7.1. Here's my `.vimrc` (identical across all machines): https://github.com/tswett/setup/blob/c84c8908a04a1d925d90da3da4f2fc83bf56172b/.vimrc

Original source