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
Does
vimon Appa otherwise behave correctly? That is, do you have the problem whenever you runvim, or only when usinggit commit?If the former:
Are you sure that
git commitis runningvim? Many applications default to usingviin the absence of any other configuration, and it’s typical forvito either (a) a very minimal version ofvimmissing lots of fancy features or (b) something completely different.Try explicitly setting
core.editortovimand see what happens:Alternatively, you can also set your
EDITORandVISUALenvironment variables.