I have used homebrew to install both Vim and MacVim on my mac. Right now, MacVim is the one that is linked. When I run mvim --version
, I get the most recent and installed version that appears. When I run vim --version
, the one pre-installed on the computer comes up, even though Vim has been installed via homebrew and is fully up to date. How can I make it so both mvim
and vim
link to their respective homebrew installed version, rather than only mvim
with vim
not being up to date, or vim
with mvim
not working?
-
1What is your $PATH ?– mmmmmmCommented Oct 31, 2021 at 18:40
-
Create aliases pointing to the latest version in Cellar– nohillside ♦Commented Oct 31, 2021 at 19:33
1 Answer
To expand on @mmmmmm's comment, run echo $PATH
in your terminal. Make sure homebrew's path, which is /opt/homebrew/bin
on M1/Apple Silicone Macs and /usr/local/bin
on Intel Macs, is before your system's /usr/bin
Also run cat .zprofile
or open your .zprofile
in your editor of choice. Make sure you have a line like: eval "$(/opt/homebrew/bin/brew shellenv)"
(M1/Apple Silicone) or eval "$(/usr/local/bin/brew shellenv)"
(Intel). If you want brew
packages to have precedence over other third-party packages, make sure that line is at the end of the file.