I have installed vim by brew on the newest Mac OS:
brew install vim
And when I type brew info vim
, it shows:
vim: stable 7.4.891, HEAD
Vi "workalike" with many additional features
http://www.vim.org/
Conflicts with: ex-vi
/usr/local/Cellar/vim/7.4.891 (1612 files, 28M) *
Built from source
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/vim.rb
...
But if type vim
, it shows me a 7.3
version's vim:
VIM - Vi IMproved
version 7.3
...
How can I use the 7.4
version?
Vim is a powerful code editor. So powerful that both Linux and Mac have it installed by default.
The path used by macOS's default vim install is /usr/share/vim/vimrc .
By default, it installs Homebrew so you can use the brew command without typing the sudo command and providing your password. UPDATE: The below command is no longer necessary. Homebrew Cask is now automatically installed as part of Homebrew itself.
Just need exit the terminal and re-enter, brew will install vim link at /usr/local/bin/vim, but it will be enable only when terminal started.
You need to set PATH so that /usr/local/bin
appears before /usr/bin
vim .zshrc(if you use zsh) or .bash_profile and paste
export PATH=/usr/local/bin:$PATH
hope this help you!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With