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 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.
Mouse support can be enabled or disabled in specific vim builds. You can look at which features are enabled/disabled using: :version. On the Appa machine you'll probably see -mouse in the list.
The only solution is to use a vim that's been built with mouse support,. Unless you control the server this means:
bin directory, andEDITOR environment variable to point to your own vim.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With