15

Finally, vim 8.0 has been released! However, the pre-installed vim is vim 7.3 on my system(OS X El Capitan), and I want to upgrade it to the newest 8.0 version.

So how can I do this without messing things up? Would it be a good idea to simply override the vim in /usr/bin/vim? And what about compiling it from source?

1

2 Answers 2

24

Get the Homebrew* package manager.

Install vim formula (as of today it is Vim 8.0.2) with:

brew install vim

Check the messages it produced for any manual actions you might be required to perform, although with Vim formula there should be no issues.

One more thing you should do is to check your environment variables for those that might contain a full path to the system vi/vim, like EDITOR and update them to use the /usr/local/bin/vim.


If you had Homebrew already installed, before running the install command, update the local repository with:

brew update

If you had Vim already installed with Homebrew (or if in the future you'd like to upgrade the Vim version), then run:

brew upgrade vim

* Homebrew is an open-source, actively maintained package manager for Mac OS X. It keeps the packages in /usr/local/Cellar folder by default. It stores links to the executable files /usr/local/bin and puts this directory ahead of system directories in the PATH environment variable. Your /usr/bin/vim can thus be left alone.

Homebrew will also take care of all the paths and dependencies for installed packages.

3
  • works for me. I had to add /usr/local/bin/vim to my PATH environment variable Nov 25, 2017 at 9:03
  • For me it says, Error: vim 8.0.1650_1 already installed when I do brew upgrade vim
    – R11G
    Apr 6, 2018 at 0:31
  • @R11G, you can brew reinstall vim if you're already on the most current version Sep 20, 2018 at 22:40
4

You can install vim with Homebrew overriding the current system's vim with the --with-override-system-vi:

brew install vim -- --with-override-system-vi 

Remember to restart your terminal after that to make sure the new symbolic links work as expected.

2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .