Using git to clone the source code and change directory to vim/src, build the source code using make and then install it into /usr/local/bin.
After above, restart the terminal, run below commands to verify the installation.
If you want to add python and python3 support, then the ./configure must be properly applied.
Option –enable-fail-if-missing is to see the errors for configuration and stop the configuration immediately.
By running above build configuration command, you will see something like below, and the lines with "python" and "python3" are about your python configuration where you can know whether your python paths are correctly configured.
Then run sudo make && make install to install vim.
Verify your python is enabled by running command vim --version. You should be able to see +python/dyn and +python3/dyn which means python are enabled.
Sometimes, we also want to use a GUI version of vim on Mac. MacVim is one of the GUI vim on Mac OS. You can clone the source code from Github (https://github.com/macvim-dev/macvim.git), compile and install it. The process is similar as installing vim from source code. Also, you can install it via brew like below.
For future easier access to it, you can add it to your Applications directory.
Alternatively, you can download the .dmg file from the release page https://github.com/macvim-dev/macvim/releases/ .