Installing vim with homebrew assistance

前端 未结 6 438
生来不讨喜
生来不讨喜 2021-02-03 23:09

I tried to install YouCompleteMe on Mac for vim, but I\'ve been using the system vim which is version 7.3. I tried to update my vim using homebrew by typing brew install v

相关标签:
6条回答
  • 2021-02-03 23:31
    echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bash_profile
    source ~/.bash_profile
    

    Run this command and it will be fixed.

    0 讨论(0)
  • 2021-02-03 23:47

    You're loading your system vim first, as you can see by which vim returning /usr/bin/vim instead of /usr/local/bin/vim.

    /usr/local/bin is homebrew's path.

    Make sure that your path lists /usr/local/bin before /usr/bin:

    /usr/local/bin:/usr/bin
    

    This will allow homebrew's vim to be sourced before the system vim.


    To view your path:

    echo "$PATH"
    
    0 讨论(0)
  • 2021-02-03 23:48

    brew install vim --with-override-system-vi (missing the with-)

    0 讨论(0)
  • 2021-02-03 23:51

    You should probably have done brew install vim --with-override-system-vi. This will replace default vim path.

    0 讨论(0)
  • 2021-02-03 23:52

    Rather than reinstalling vim you can move your current vim to vim73 (or something similar).

    First check if /usr/local/bin is present in PATH environment variable. Doing echo $PATH on your terminal should do that.

    Install vim with homebrew if you haven't already.

    brew install vim
    

    Then move your current vim installation.

    mv /usr/bin/vim /usr/bin/vim73
    

    Run which vim to confirm. It should say /usr/local/bin/vim.

    0 讨论(0)
  • 2021-02-03 23:57

    Just install vim via homebrew:

    brew install vim
    

    Then restart your shell:

    exec -l $SHELL
    

    And check the version:

    $ vim --version|head -n 1
    VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar  9 2016 19:07:39)
    
    0 讨论(0)
提交回复
热议问题