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

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

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

up vote 2 down vote accepted

Macvim normally is opened from the command line with


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
  • 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


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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