'Uninstalled MacVim, now can't use regular Vim?

I got a new machine at work. The previous developer had macvim installed. When typing 'vim' in the terminal, the macvim program would open. I uninstalled macvim because I don't use it. Now when I type 'vim' in the terminal, it says, "Sorry, cannot find MacVim.app." I want to just run vim in the terminal. Is this an alias or something? How can I quickly fix!



Solution 1:[1]

you can enter this into the terminal:

which vim
alias

to see info about defined aliases and what happens when you try to run vim

Solution 2:[2]

The previous user installed the mvim script that comes with MacVim somewhere in the $PATH or elsewhere and probably symlinked it or created an alias.

To get rid of that behaviour, try the following:

  • look into your ~/.bashrc or whatever if there's an alias that point at mvim
  • look everywhere in your $PATH for a mvim script, maybe

    $ which mvim
    

    will do

  • make sure /usr/bin/vim is a real Vim executable and not a symlink with this command

    $ file /usr/bin/vim
    

If it's symlinked then you have trouble, If it's only an alias simply remove it. If you don't want to mess around too much, you can add an alias to /usr/bin/vim in your ~/.profile or whatever.

Whatever you do, I'd recommend you to re-install MacVim as it is a lot better than the default Vim in almost every way.

Solution 3:[3]

Is there still a file here: /usr/bin/vim ?

If that got deleted, then you'll need to reinstall vim.

I suggest using Link as your package manager

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Minthos
Solution 2 Brian Diggs
Solution 3 Glorfindel