I installed Vim 7.3 via MacPorts, and it worked great. However, after I closed Terminal and came back to it, I found out after a little bit that it had reverted to the old 7.2. How do I remove the old, default vim in OSX or force it to use the macports version?


It's probably a problem with your $PATH variable. Check to verify that the vim7.3 install path is in your $PATH variable. If it is make sure it is before the install path for vim7.2.

The vim installer probably set an environment variable for your current shell that isn't in your ~/.profile or ~/.bashrc

  • Instead I made a symlink to the macports version and that works great. I'd be willing to accept yours as the answer, but I'll wait to see if you or others would give a "best practices" opinion. What I mean is, should I just remove the old vim via $ rm /usr/bin/vim-bak? What about other macports? Do I add the path every time I have a conflict? It sounds a little dodgy, so I want to know the best way. – labyrinth Dec 16 '10 at 17:49
  • 2
    This answer is the best practice. /opt/local/bin should be in your $PATH if you're interested in using MacPorts. – fideli Dec 16 '10 at 17:59
  • Nope, adding it to the path doesn't work. Even though vim7.3 is indeed in the /opt/local/bin, osx wants to use the vim7.2 in /usr/bin (and yes, I did source my .bash_profile and verify by echo $PATH). – labyrinth Dec 16 '10 at 18:12
  • I would remove the old vim. Here's what I dow with git. When I install and build a new git it goes in a totally new directory and I update the symlink. This is all taken care of in a script that downlaods git, builds, installs, and updates the symlink. – Mark Thalman Dec 16 '10 at 18:33
  • What do you mean by 'osx wants to use the vim7.2 in /usr/bin' what action do you do – user151019 Dec 16 '10 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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