One of the easiest way to install MacVim is via Homebrew. If you do not have Homebrew install I highly recommend you install it. Just go to this site brew.sh and follow the install instructions there.
Once you have home brew installed you should be able to run the command
This will install and compile macvim if you have the appropriate dependencies installed. If you install completes then you have everything installed as it needed. However sometime you will be prompted with an error message asking you to install something or debug why it failed.
When I decided to install MacVim via Homebrew I was greeted with this lovely error message.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
The solution was the tell xcode which directory its looking at for the build tools. If you do not have xcode already installed you will want to do so, its a very easy install via the mac app store.
Then you run this command.
Then you can feel free to try and brew install macvim. If it still fails you will want to run.
After that MacVim should compile on your machine and you’re ready to start vim-ing it up!