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 Vim 7.4 on my MacBook using Homebrew. When I enter vim on the command line, it successfully enters Vim 7.4, but when I use vi I still get the old 7.3.

To install Vim 7.4 I used this command:

brew install vim --override-system-vi

When I do which:

$ which vi
/usr/local/bin/vi

When I execute this path in my shell /usr/local/bin/vi it does open 7.4. So I thought it might be an alias, but alias vi didn't find anything.

I'm quite puzzled by this and I have no idea why this happens. Does anyone know why this might be happening and how to fix it? I could of course make an alias of vi to vim but I wonder why it works the way it does right now.

share|improve this question
    
What does type vi tell you? –  slhck Aug 12 '13 at 12:24
    
@slhck Thanks, that helped me! I found the problem now, see my answer. –  rednaw Aug 12 '13 at 12:39

1 Answer 1

up vote 6 down vote accepted

Whenever you change paths, or install new binaries, you should always:

  • restart your shell, or
  • rehash the loaded binaries (e.g. in Bash with hash -r or Zsh with rehash)
share|improve this answer
    
hash -r worked for me, thanks –  rednaw Aug 12 '13 at 12:44

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.