How update vim to 8.0 version in OSX?

vim
37,274

Solution 1

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

Solution 2

Trying

brew install vim --override-system-vim

didn't work for me either.

Upgrade Homebrew to latest version and then use

brew upgrade vim

Solution 3

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.

Solution 4

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

sudo make install

That should install it to your path.

Share:
37,274
Ladih
Author by

Ladih

Updated on July 09, 2022

Comments

  • Ladih
    Ladih almost 2 years

    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.

  • Keith Thompson
    Keith Thompson over 7 years
    Will that install vim 8.0? (I.e., does Homebrew know about the latest version yet)?
  • L3viathan
    L3viathan over 7 years
    Homebrew is usually very up-to-date, so yes, you'll get vim 8 (I have it too).
  • Ladih
    Ladih over 7 years
    I tried this method, and installed vim 8.0 successfully. However, the vim is in still 7.3 version. So I set an alias to vim 8.0 in that folder.
  • jshort
    jshort over 7 years
    Put /usr/local/bin first in your path. And brew is on it's 4th or 5th minor version update of vim 8 (8.0.0019 as of just a few days ago).
  • Admin
    Admin over 7 years
    I've just tried the brew install vim --override-system-vim command but it updated vim to the version 7.4, not 8
  • James Hulse
    James Hulse about 7 years
    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.
  • thenew
    thenew about 7 years
    Warning: vim: this formula has no --override-system-vim option so it will be ignored!
  • wting
    wting about 7 years
    This is supposed to be: brew install vim --override-system-vi (no m at the end).
  • oalders
    oalders almost 7 years
    Looks like it's now brew install vim --with-override-system-vi
  • UtsavShah
    UtsavShah almost 7 years
    You don't need to upgrade Homebrew, it'll update itself automatically
  • Steven Aguilar
    Steven Aguilar over 6 years
    when I run vim in the command line version 7.3 is shown. However, when I run brew upgrade vim I get Error: vim 8.0.0728_1 already installed How do I switch to version 8?
  • AnthonyB
    AnthonyB over 6 years
    It didn't override the /usr/bin/vim in my case, perhaps I should use sudo. Instead I used sudo ln /usr/local/Cellar/vim/<myVimVersion>/bin/vim /usr/bin/vim`
  • Hafenkranich
    Hafenkranich over 6 years
    @Steven Angular I had the same problem. Re-opening the console solved this.
  • avriis
    avriis over 6 years
    @GerardoZinno Had the same issue, but realised that it was an issue with home brew (I have an old version, which I discovered with brew -v). See this thread on home brew support for how to fix this: discourse.brew.sh/t/how-to-upgrade-brew-stuck-on-0-9-9/33
  • Jasha
    Jasha almost 6 years
    Using the homebrew formula above, I now have vim 8.0 at /usr/local/bin/vim and vim 7.3 at /usr/bin/vim. Any recommendations for how to rearrange my path? Or should I delete /usr/bin/vim and replace it with a symlink?
  • L3viathan
    L3viathan almost 6 years
    When you start vim, is the correct Vim started? If yes, leave it be, you should not delete the system Vim. If no, adjust your path e.g. by putting export PATH="/usr/local/bin:$PATH" in your .bashrc, .zshrc, or similar.
  • naiJenn
    naiJenn over 4 years
    worked without using --with-override-system-vi as it is an invalid option.
  • pjo336
    pjo336 almost 4 years
    God bless the sounds dumb addition, I was dumb