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 just installed macvim for the ease of installation and integration with Ruby and Python already built in. I know I can just double click on the vim.app icon to open a new window, but how can I make it so that if I am in terminal and type "vim" it will open the vim that macvim newly installed instead of the one that comes on mac.

Right now if I type in "vim" I get the one that was preinstalled, but I want it to open macvim. Any suggestions?

Thanks in advance, Max

share|improve this question

migrated from stackoverflow.com Jun 20 '13 at 20:12

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 2 down vote accepted

Macvim normally is opened from the command line with

mvim

If you take the mvim script that came with MacVim and plave it in ~/bin (or symlink it if you prefer)

Then in your ~/.bashrc add the following line.

export PATH="~/bin:$PATH"

Then execute

source ~/.bashrc

This will place mvim in your PATH so that you can execute it.


If you want to alias vim to open macvim you can add the following to your ~/.bashrc (if mvim is not in your path)

alias vim=<full path to mvim>

If mvim is in your PATH you should just be able to put

alias vim=mvim
share|improve this answer
    
I get command not found.. I just stuck the unzipped folder into /Applications/ which contains MacVim, mvim, and README.txt –  mharris7190 Jun 20 '13 at 17:02
    
@mharris Add mvim to your PATH. –  FDinoff Jun 20 '13 at 17:06
    
@mharris7190 see edit –  FDinoff Jun 20 '13 at 17:18
    
I don't have ~/.bashrc ? no such file or directory... Is there something I am missing? –  mharris7190 Jun 20 '13 at 18:31
    
@mharris7190 just create missing files or directories –  FDinoff Jun 20 '13 at 18:33

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.