1

My machine came with Vim 7.3 and I just installed MacVim 7.4, so now I'm juggling both and I'm not sure how to manage the two. I'm plagued by questions like:

  • Should I remove the older version?
  • Where should MacVim be located?

Currently MacVim.app is in /Applications, and I see a couple executables at /Applications/MacVim.app/Contents/MacOS/MacVim and /Applications/MacVim.app/Contents/MacOS/Vim.

The pre-installed Vim 7.3 is sitting at /usr/bin/vim.

I'd like to be able to use 7.4 both from the terminal and in MacVim. I haven't installed MacVim's "mvim" script and not sure I will.

What is the best way to set this up?

Anthon
  • 79,293
ivan
  • 1,878

1 Answers1

2

You can set an alias for vim in your ~/.bashrc

alias vim=/Applications/MacVim.app/Contents/MacOS/Vim

With this the Bash will replace ´vim with/Applications/MacVim.app/Contents/MacOS/Vim`, when you type something like this:

vim ~/.bashrc

So you don't need to remove /usr/bin/vim, which is probably a bad idea anyway.

  • Solved my dilemma and taught me how to set an alias :) – ivan Sep 15 '13 at 04:11
  • I just noticed that although setting the above alias did fix my problem, which vim still shows the older version use/bin/vim. Is that to do with the order of things in my $PATH? Should I do anything about that? – ivan Sep 18 '13 at 01:07
  • 1
    Have a look at http://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then. It explains the problem. It basically comes down to the fact that which only looks at $PATH and thinks like type look also at aliases. – Raphael Ahrens Sep 18 '13 at 04:58