8

When I edit a commit message with vim (by entering git commit), vim opens, but first with a prompt that the YouCompleteMe plugin is unavailable:

$ git commit
YouCompleteMe unavailable: requires Vim 7.3.584+
Press ENTER or type command to continue

When I check the version using :version after pressing ENTER, I see that vim 7.3 is running. However, if I start vim directly from the command line (not using git commit), I see that I'mrunning vim 7.3.754. How can I tell git to use the newer version of vim?

Chris Chambers
  • 1,367
  • 21
  • 39
Travis Northcutt
  • 24,666
  • 9
  • 42
  • 51

2 Answers2

9

Use

git config --global core.editor /my/version/of/vim
djechlin
  • 59,258
  • 35
  • 162
  • 290
  • Excellent, thank you! FWIW, I only had to use "vim", not the full path, because I had previously created a symlink from there to /usr/local/bin/mvim as suggested in the installation instructions for YouCompleteMe: https://github.com/Valloric/YouCompleteMe – Travis Northcutt Apr 23 '13 at 16:41
2

This solved my issue.

git config --global core.editor `which vim`
mainframer
  • 20,411
  • 12
  • 49
  • 68