TL;DR: gvim is aliased from the MacVim application's bin folder and you can add that bin directory to your $PATH variable to enable access to gvim from the terminal.
I recently downloaded the latest MacVim.dmg file from https://github.com/macvim-dev/macvim/releases, opened it, in the window that pops up, dragged the MacVim icon to the Applications icon, then closed that window and ejected the MacVim.dmg installer from the finder.
From a finder window I navigated to the /Applications
folder, I right-clicked on MacVim.app and selected "Show Package Contents". Then I opened Contents/bin
and there found a set of symlinks from mvim and gvim to vim.
I opened a terminal, and changed directory to the home directory by typing cd ~
. From the home directory, I typed ls -al
to list all files even the hidden ones which start with a dot, and verify there was a .bash_profile file. (If you don't have this file, see if you have any other other profile files, or search the web to determine which to use or add, so that you can set the following additions to your $PATH variable and have them persist after you log out and back in.)
From the home directory, I used my favorite editor to edit the .bash_profile
file, and added the following line to add MacVim's bin file to the $PATH variable:
export PATH=$PATH:/Applications/MacVim.app/Contents/bin
I saved and exited the .bash_profile file, then loaded my change with source .bash_profile
. Now when I type in the terminal which gvim
it lists that location, and I can run gvim from the terminal to open a file.