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'm on a mac osx and I need to re-install or build VIM with some custom switches.

How should I go about doing this? Will it just write over the existing or should I un-install somehow?

I know macvim has it (+Ruby interpreter), but I want the standard vim to work.

share|improve this question

2 Answers 2

If you do the normal make process:

./configure; make; make install

it will install the new binary vim in your /usr/local/bin directory. You can then either run it directly with /usr/local/bin/vim or make an alias in your .bashrc such as:

alias vim="/usr/local/bin/vim"

Then when you type vim at the command prompt it will run the new version of vim. The old version will remain at /usr/bin/vim. I wouldn't recommend deleting it as you may need to run it in the future.

share|improve this answer
    
You can also change your PATH so /usr/local/bin is searched before /usr/bin. BTW, another reason to put your custom vim in /usr/local/bin and leave the regular one alone, is so your custom version won't get randomly overwritten by a system update. –  Gordon Davisson Jul 17 '11 at 5:13

I know that building something from source can be a weird source of pleasure — that's what I feel anyway — but there is a regular (CLI) Vim executable within MacVim's bundle with all the same functionalities.

Add this line to your ~/.bashrc or ~/.profile or wherever you are used to put aliases and custom bash functions:

alias vim='/path/to/MacVim.app/Contents/MacOS/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.