37

The current vim i'm using is 7.3 version.

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 14 2016 16:06:49)
Compiled by [email protected]

I tried to update vim to 8.0 by the command:

git clone https://github.com/vim/vim.git
cd vim/src
make

However, it doesn't work. It's still vim 7.3.

2
  • Download the latest MacVim release.
    – romainl
    Oct 5, 2016 at 5:23
  • Actually, this is correct to build vim for console; make install to install it. Nice to know how easy it is without any package managers.
    – DS.
    May 21, 2019 at 14:58

4 Answers 4

68

You may have compiled vim, but the vim that's first in your path is still the system vim. You can show that using:

$ which vim
/usr/bin/vim

You can either call your compiled vim directly (probably in a folder called dist or bin), or put it in a place that is before /usr/bin in your $PATH variable. The easiest way to get an up-to-date vim on OS X is to use Homebrew:

$ brew install vim --with-override-system-vi
16
  • 1
    Homebrew is usually very up-to-date, so yes, you'll get vim 8 (I have it too).
    – L3viathan
    Oct 4, 2016 at 21:18
  • 4
    I've just tried the brew install vim --override-system-vim command but it updated vim to the version 7.4, not 8
    – user6214276
    Oct 7, 2016 at 11:30
  • 4
    This updates the command vim on my mac and not vi. To point vi to the latest version I had to add alias vi="vim" to my bash configuration .bashrc/.zshrc. Jan 25, 2017 at 17:34
  • 3
    This is supposed to be: brew install vim --override-system-vi (no m at the end).
    – wting
    Apr 15, 2017 at 3:40
  • 4
    @Steven Angular I had the same problem. Re-opening the console solved this. Sep 11, 2017 at 16:34
14

Trying

brew install vim --override-system-vim

didn't work for me either.

Upgrade Homebrew to latest version and then use

brew upgrade vim
1
  • 4
    You don't need to upgrade Homebrew, it'll update itself automatically
    – UtsavShah
    May 31, 2017 at 21:08
8

vim --version

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

Sounds dumb but most importantly close the terminal and then reopen it to see the new version of vim $ vim --version.

1
  • 3
    God bless the sounds dumb addition, I was dumb
    – pjo336
    May 2, 2020 at 18:16
3

You are missing the final step for installing from source after running make:

sudo make install

That should install it to your path.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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