Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've installed Vim and Git to C:\Program Files (x86)\(vim|git) respectively.

When I run Vim from Git Bash, it runs the internal version of Vim that came with the Git installer. Is there a way to override this behavior that doesn't involve changing my .profile or .bashrc or the like so that I can run the version of Vim that I installed in Program Files?

Thanks.

share|improve this question

3 Answers 3

By default Git runs vim from Git\bin\vim. This is actually a script that contains path to the executable itself:

#!/bin/sh
exec /share/vim/vim73/vim "$@"

Therefore you can edit this file to point to your Git location.

The default editor can be overridden in Git\etc\gitconfig:

[core]
editor = path_to_your_editor
share|improve this answer

Assuming that changing content of C:\Program Files (x86)\{vim,git} is possible you have at least these two options depending on value of your %PATH% environment variable:

  1. If you have C:\Program Files (x86)\vim\vim73 in your %PATH% you can just remove vim binary that was installed with Git. For this to work Vim should be run as vim and not by a full path.

  2. You probably have your Program Files (x86) directory on a NTFS volume, so you can remove Vim executable installed by Git and make a symbolic link to real Vim executable.

share|improve this answer

Edit your \bin\vim file and comment out its contents, because erasing it is a pain to do without a true Linux environment.

Go to your Windows 8.1 Control Panel and search for 'path'. The result of "Edit environment variables for your account" will show up, click it. Add the path to your VIM installation to the end of the PATH statement. ie ;C:\Program Files (x86)\Vim\vim74 save & reboot

$echo $PATH you should see your new VIM path show up at the end. Run $vim.exe from anywhere on your machine as a sanity check. Edit your ~/.bashrc put in an alias statement to vim.exe to 'vim'.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.